标签: android-3.0-honeycomb

在单个活动中使用多个片段

我想开发一个Android应用程序,Honey Comb 3.0在其中我要显示一个列表,单击列表中的任何项目应该以Fragment的形式显示该列表项旁边的另一个列表.在解决这个问题时,任何人都可以提供示例代码吗?

提前致谢,

android android-3.0-honeycomb

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

在FragmentManager中管理BackStackEntries

如何清除BackStackEntriesFragmentManager?这是我用来更改片段对象的代码:

FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
Fragment homeFragment = new Home();
fragmentTransaction.replace(R.id.mainFragement, homeFragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
Run Code Online (Sandbox Code Playgroud)

在特定情况下,我需要删除完整的backstack条目.我没有在片段管理器中找到任何特定的方法.你有什么想法?

android android-fragments android-3.0-honeycomb

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

在创建Honeycomb Action Bar选项卡后更改选项卡文本

我正在尝试通过创建一个使用Action Bar和标签的简单文本编辑应用程序来使用Android Honeycomb.我遇到了一个恼人的问题.创建选项卡并将其添加到操作栏后,我想更改选项卡上显示的文本.我认为使用以下方法,ActionBar.Tab.setText(CharSequence arg0)可以做到这一点,但是,它似乎并没有改变可视文本.更奇怪的是,如果我调用getText(),它会返回我将标签更改为的文本.下面是我用来更改标签文本的代码片段:

int currentTabIndex = ab.getSelectedNavigationIndex();
currentTabTitle = (String) ab.getTabAt(currentTabIndex).getText();  // just to check
ab.getTabAt(currentTabIndex).setText(fileName);                     // change tab text
currentTabTitle = (String) ab.getTabAt(currentTabIndex).getText();  // just to check
Run Code Online (Sandbox Code Playgroud)

我真的很茫然,到处搜寻.我非常感谢任何人的建议.谢谢你的时间.

tabs android settext android-3.0-honeycomb android-actionbar

5
推荐指数
2
解决办法
2336
查看次数

Honeycomb中的上下文操作栏

我想根据屏幕上选择的内容更改代码中的Action Bar按钮.

这有点像Honeycomb Gmail应用程序,您可以在其中查看一些邮件项目,并获得具有不同外观的不同操作栏.

知道我怎么能这样做吗?

android android-3.0-honeycomb android-actionbar

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

使用add()方法添加片段不会隐藏先前的片段

当使用add()方法添加新片段时,我遇到了"意外行为".

我想在FrameLayout上添加一个新片段,但是当我这样做时,前面的片段仍然可见.

  • 这是使用add()方法时的预期结果吗?

  • 这是因为我使用FrameLayout和add()方法只是在FrameLayout上放置一个片段而不影响前一个?

谢谢

android fragment android-fragments android-3.0-honeycomb

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

无意在蜂窝上观看jpg?

这里有一些代码可以在手机上正常工作:

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(IMAGEURI, "image/jpg");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

哪个在Honeycomb(3.0和3.1)上抛出这个:

E/AndroidRuntime(25629): FATAL EXCEPTION: main
E/AndroidRuntime(25629): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=content://media/external/images/media/282 typ=image/jpg }
Run Code Online (Sandbox Code Playgroud)

真?没有申请在蜂窝上观看jpg?真?有没有人能够在平板电脑上正确地做到这一点?

android jpeg actionview android-3.0-honeycomb

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

ActionBar中菜单项的动画

当你长时间点击Gmail应用程序(Honeycomb)中的电子邮件项目时,会显示类似上下文的菜单,其中的项目在开始时被动画化.怎么做的?谢谢.

android android-3.0-honeycomb

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

在Honeycomb上使用Android兼容性库的缺点

我想知道您对在Honeycomb设备上使用ACL的不利之处的看法.

我想将库专门用于我的应用程序- 即使它在Honeycomb上运行 - 否则我将不得不创建两个大多数相同类的版本.

主要是我对兼容性库的功能(错误),其性能和内存使用情况与本机Honeycomb SDK感兴趣.因此,如果您有为ACL和Honeycomb创建单独类的经验,请告诉我结果是否值得付出努力 - 我应该创建重复的类还是仅使用ACL.

一如既往,感谢您的支持:)

compatibility android android-3.0-honeycomb

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

如何通过附加按钮从自定义丰富通知中关闭Android> = 3.0中的通知下拉菜单?

I successfully created a custom rich notification for Android >= 3.0 that shows some text and an additional button. If you click the notification anywhere but on the button in the notification drop-down, the notification is dismissed, the drop-down closed and the specified Intent is launched as expected. If the dedicated button in the notification is clicked, a different Intent is successfully launched, but the drop-down keeps open (and the notification is still there, but I cancel it later, that …

notifications android android-3.0-honeycomb android-4.0-ice-cream-sandwich

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

Android StackWidget无法绑定

我目前正在尝试向我的应用程序添加一个小部件,并将我的实现基于此代码http://developer.android.com/resources/samples/StackWidget/index.html

我已将所有与堆栈小部件相关的类放在我的主包中的自己的包中.包setyp

当我尝试添加小部件时,它无法绑定,因此不显示卡(它只是声明默认文本"这是空视图")

以下是我的清单.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.bencallis.dealpad" android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application android:icon="@drawable/ic_launcher"
        android:logo="@drawable/logo" android:theme="@style/DealPadTheme"
        android:hardwareAccelerated="true" android:uiOptions="splitActionBarWhenNarrow">
        <activity android:label="@string/app_name" android:name=".DealPadActivity"
            android:configChanges="keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".SettingsActivity" />
        <activity android:name="com.google.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />


        <!-- Widgets -->
        <receiver android:name=".stackwidget.StackWidgetProvider">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
            <meta-data android:name="android.appwidget.provider"
                android:resource="@xml/stackwidgetinfo" />
        </receiver>

        <service android:name="stackwidget.StackWidgetService"
            android:permission="android.permission.BIND_REMOTEVIEWS"
            android:exported="false" />


    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

错误信息:

E/RemoteViewsAdapterServiceConnection(474): bind(): Unknown component ComponentInfo{com.bencallis.dealpad/com.bencallis.dealpad.stackwidget.StackWidgetService} …
Run Code Online (Sandbox Code Playgroud)

android android-widget android-3.0-honeycomb android-4.0-ice-cream-sandwich

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