小编Ore*_*est的帖子

两个发射器活动

我有两个标有intent过滤器的活动

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="7" />

<application
    android:name=".MyApp"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >

    <!-- work order activity -->
    <activity
        android:name=".app.WorkOrderActivity"
        android:label="@string/work_order"
        android:taskAffinity="com.package.task_for_work_order_activity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <!-- inventory activity -->
    <activity
        android:name=".app.InventoryActivity"
        android:label="@string/inventory"
        android:taskAffinity="com.package.task_for_inventory_activity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

问题是,当我安装apk文件时,没有显示任何活动,因为据我所知,系统无法指定应显示哪些活动.

我真的需要在启动器中显示两个活动,所以请不要提供有关从第二个活动中删除intent-filters的建议,或者如果你这样做,请提供另一种在启动器中显示两个图标的方法.

android android-activity

44
推荐指数
1
解决办法
4万
查看次数

ViewPager里面的片段问题

我在查看寻呼机的问题是在一些片段内部.要使用视图寻呼机,我正在使用FragmentPagerAdapter.确定我收到 java.lang.IllegalStateException:尝试运行我的应用程序时递归进入executePendingTransactions异常.

大多数人都认为将FragmentPagerAdapter放在其他片段中是不可能的,所以如果这个问题无效,我很抱歉.我只是希望有人对这个问题及其可能的解决方案有一些新的想法.

PS我有一个建议在AsyncTask中设置适配器(我可以澄清这种情况,如果有人需要它),但这个解决方案有一些与恢复这样的片段状态相关的错误,所以它对我有用.

android android-fragments android-viewpager android-nested-fragment

15
推荐指数
1
解决办法
9889
查看次数

如何从ArrayBuffer获取二进制字符串?

在JavaScript中从ArrayBuffer获取二进制字符串的方法是什么?

我不想编码字节,只是将二进制表示形式为String.

提前致谢!

javascript arraybuffer

14
推荐指数
3
解决办法
2万
查看次数

在ScrollView中滚动EditText

我有一个讨厌的问题.我有EditText(8行)里面ScrollView.当我试图滚动文本时,EditText它的行为并不稳定.有时它会滚动,有时它不会聚焦.

这是我的布局文件,让我的问题更清晰:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="8dp" >

    <TextView
        android:id="@+id/wo_task_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/no_description" />

    <TextView
        android:id="@+id/wo_task_description"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/no_description" />

    <TextView
        android:id="@+id/wo_task_comments_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="@string/comments" />

    <Button
        android:id="@+id/wo_task_select_comment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/select_comment_from_template" />

    <EditText
        android:id="@+id/wo_task_comments"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="top|left"
        android:hint="@string/enter_your_comment_here"
        android:lines="8"
        android:maxLines="10"
        android:minLines="6"
        android:scrollbars="vertical"
        android:singleLine="false" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我知道我有这个问题,因为在另一个内部有一个可滚动的控件,但我不知道该怎么做.所以,如果可以,请帮助我.

提前致谢.

public void initComments(final View view) {
    EditText comment = (EditText) view.findViewById(R.id.wo_task_comments);

    comment.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(final View v, final MotionEvent motionEvent) {
            if (view.getId() …
Run Code Online (Sandbox Code Playgroud)

layout android scrollview android-edittext

8
推荐指数
1
解决办法
7990
查看次数

清除检查问题后的android radiobutton检查

朋友.我对放射线组有一个非常愚蠢的问题.但我无法找到解决方案.

我将尝试描述如何重现我的问题:我有radiobutton组和里面的两个按钮.我选择其中一个,让我们说第一个.然后我通过调用radioGroup.clearCheck()清除选择 在我尝试选择第一个按钮后,但它没有检查.如果我检查第二,它会正常检查.如果我在检查第二次后检查第一,它也能正常工作.

这可能听起来很疯狂,但我无法修复它.请帮助我,提前谢谢.

我用

@Override
protected void init() {
    View view = View
            .inflate(getContext(), R.layout.wo_task_yn_result, null);

    performed = (RadioButton) view.findViewById(R.id.yn_yes);
    notPerformed = (RadioButton) view.findViewById(R.id.yn_no);

    radioGroup = (RadioGroup) view.findViewById(R.id.yn_options);

    performed.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(final CompoundButton buttonView,
                final boolean isChecked) {
            Log.d(YES, "verify");
            if (isChecked) {
                Log.d(YES, "checked");
                result = YES;
            }
        }
    });

    notPerformed.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(final CompoundButton buttonView,
                final boolean isChecked) {
            Log.d(NO, "verify");
            if (isChecked) {
                Log.d(NO, "checked");
                result = NO; …
Run Code Online (Sandbox Code Playgroud)

android radio-button

8
推荐指数
2
解决办法
6298
查看次数

android视图默认填充或边距

看起来像TextView这样的一些视图有自己的填充或边距...我的意思是当我将textSize 16dp设置为textView时,在hdpi设备屏幕上需要超过24个像素才能显示此控件.也许我错过了什么,请帮忙

<LinearLayout
        android:id="@+id/uc_button_title_panel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="@color/closed_red" />

        <TextView
            android:id="@+id/uc_button_title_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="0dp"
            android:includeFontPadding="false"
            android:background="@null"
            android:padding="0dp"
            android:text="@string/demo_text"
            android:textColor="#325083"
            android:textSize="16dp"
            android:textStyle="bold" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="@color/closed_red" />
    </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android view

6
推荐指数
1
解决办法
1万
查看次数

清除片段后栈编程

清除片段后栈编程的最佳方法是什么?

我只使用一个活动和一组片段实现了屏幕导航.我想有一个方法将用户带到登录屏幕(当注销超时到期时)并清除所有片段历史记录,最好的方法是什么?我在这里找到的答案很少但我不知道哪个是最好的...提前谢谢!

目前我正在使用这个

public void clearBackStack() {
    FragmentManager fragmentManager = holder.getSupportFragmentManager();

    while (fragmentManager.getBackStackEntryCount() != 0) {
        fragmentManager.popBackStack(null, 0);
    }
}
Run Code Online (Sandbox Code Playgroud)

然而,有时我会出现OutOfMemoryException

android fragment

3
推荐指数
1
解决办法
9609
查看次数

Twilio将聊天记录存储多长时间?

我一直在浏览Twilio的文档和API参考,但无法找到聊天记录的存储时间。

我没有任何自己的数据库来存储消息,也没有与聊天相关的后端逻辑。我正在使用Twilio为我处理所有事情。我仅使用他们的客户端SDK进行交互。

谁能帮助我。提前致谢。

chat twilio web

1
推荐指数
1
解决办法
423
查看次数