我正在用fragments 在Android 3.0 中做一些事情。在其中一个片段中,我需要滚动条。我尝试使用 a ScrollView,但它没有为我提供片段的滚动条。
如何获得片段的滚动条?
android scrollbar scrollview android-fragments android-3.0-honeycomb
我似乎有一个严重的问题.几个星期前,我发布了一个应用程序Antipaper Notes(com.pancerola.and.antipaper.notes).它运行在API级别11(Honeycomb)上,除此之外没有任何要求.根据市场情况:
This application is only available to devices with these features, as defined in your application manifest.
Screen layouts: SMALL NORMAL LARGE XLARGE
Required device features
android.hardware.touchscreen
This application is available to over 67 devices.
Run Code Online (Sandbox Code Playgroud)
几天前,我发布了更新的应用程序com.subhog.antipaper.notes.我需要更改包,并且有一些重要的结构变化证明了应用程序分离的合理性.但是,虽然清单没有更改,但人们在安装应用程序时遇到问题.市场说:
This application is only available to devices with these features, as defined in your application manifest.
Screen layouts: SMALL NORMAL LARGE XLARGE
Required device features
android.hardware.touchscreen
android.hardware.screen.portrait
This application is available to over 67 devices.
Run Code Online (Sandbox Code Playgroud)
所以唯一的区别是纵向列出的肖像模式.现在,奇怪的部分.67个设备的列表是相同的.摩托罗拉XOOM在两个列表中具有相同的风格.但是,有些(只有一些!)Xoom用户将应用程序标记为"与设备不兼容",无法安装它.
可能是什么原因?如果这是肖像模式,那为什么它会出现在某些平板电脑而不是其他平板电脑上呢?如果是别的什么,为什么我看不出有任何区别?
我会感激任何帮助.
compatibility android publishing android-3.0-honeycomb google-play
好的,在蜂窝上我有一些决定屏幕尺寸的功能.这有时用于动态地做一些UI的东西.但问题是它包含带有android按钮的底栏,它从你可用的屏幕尺寸中减去.
android Display功能可能正在返回正确的功能(例如,1280x800显示器将返回1280x740作为显示器,这是显示器不包括底部的android按钮)但是webview中的javascript功能只会确定实际大小,所以1280x800得到1280x800这是不正确的,因为底部栏是在那里.
如何在没有硬编码的情况下获得底栏的大小,我至少可以通过这种方式从不正确的屏幕大小整数中减去它.
android resolution android-3.0-honeycomb android-4.0-ice-cream-sandwich
我有一个BackgroundReceiver设置来接收android.intent.action.USER_PRESENT清单文件中的:
<receiver android:name="com.demo.MyBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud)
我的重写onReceive(Context, Intent)方法很简单:
@Override
public void onReceive(Context context, Intent intent)
{
if (intent != null)
{
if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())
{
// wrapper for Log.d(String, String)
Dbug.log("MyBroadcastReceiver: [" + intent.getAction() + "]");
// this calls a service
serviceExample(context, intent);
}
}
}
Run Code Online (Sandbox Code Playgroud)
问题:
android android-intent android-3.0-honeycomb android-4.0-ice-cream-sandwich
我使用ObjectAnimator API(android.animation.ObjectAnimator)来点击一个按钮(v是按钮):
ObjectAnimator animator = ObjectAnimator.ofFloat(v, "rotationY", 360f);
animator.setDuration(5000);
animator.start();
Run Code Online (Sandbox Code Playgroud)
当我在模拟器上测试它时,它适用于第一次单击(按钮旋转).但是当我再次单击该按钮(片段在第一次点击后没有被破坏等)时,我在模拟器上看不到任何动画(模拟器不是最快的,但有5秒我应该看到的东西).
我是否需要在第一个动画之后销毁/关闭某些内容或者我缺少什么?有人有提示或可以重现吗?
马丁,提前谢谢
我对Honeycomb的向后兼容性有疑问.我有一个支持2.1或更高版本的应用程序,似乎主要在Honeycomb上工作,除非他们启动TabActivity.
特别是,当我向TabHost添加标签时,我得到以下异常
android.content.res.Resources $ NotFoundException:资源ID#0x0
在查看抛出此异常的代码时,我发现它是带有标签和图标的选项卡规范.在代码内部,LabelAndIconIndicatorStrategy尝试对布局文件R.layout.tab_indicator进行充气,该文件似乎不可用.
TabHost.TabSpec spec; // Resusable TabSpec for each tab
Intent intent; // Reusable Intent for each tab
// Create an Intent to launch an Activity for the tab (to be reused)
intent = new Intent().setClass(_gameActivity, ScoreGameActivity.class);
intent.putExtra(GameChangerConstants.STREAM_ID, _stream.pk().toString());
// Initialize a TabSpec for each tab and add it to the TabHost
spec = _gameTabHost.newTabSpec("score_game").setIndicator("Score", res.getDrawable(R.drawable.icon_field_gloss)).setContent(intent);
_gameTabHost.addTab(spec);
Run Code Online (Sandbox Code Playgroud)
有没有为蜂窝创建标签的新方法,我不知道?我已经倾倒了文档,但没有看到任何表明我所做的事情的问题.
在此之前,我想避免使用片段,直到我们可以对UI小部件进行更全面的重构,并且我希望更好地理解这个问题.
在Honeycomb(Android 3.0)上运行的设备上使用AutoCompleteTextView组件(使用Motorola Xoom进行测试)时,我遇到了一个奇怪的问题.我使用以下堆栈跟踪得到Nullpointer异常:
致命异常:在android.widget.PopupWindow.getMaxAvailableHeight(PopupWindow.java:1152)在android.widget.ListPopupWindow.buildDropDown(ListPopupWindow.java:1054)在android.widget.ListPopupWindow.show(ListPopupWindow主显示java.lang.NullPointerException. java:516)在android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1047)的android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:931)在android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:914)at android.widget.Filter $ ResultsHandler.handleMessage(Filter.java:285)在android.os.Handler.dispatchMessage(Handler.java:99)在android.os.Looper.loop(Looper.java:126)在android.app .ActivityThread.main(ActivityThread.java:3997)在java.lang.reflect.Method.invokeNative(本机方法)在java.lang.reflect.Method.invoke(Method.java:491)在com.android.internal.os .ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:841)at com.android.internal.os.ZygoteInit.main(Zyg oteInit.java:599)at dalvik.system.NativeStart.main(Native Method)
请注意,我不会在包括Gingerbread在内的任何其他Android版本上获得此异常.它很难调试,因为我没有Honeycomb代码库的原始源代码.如果有人能帮助我,我将不胜感激.
谢谢,托里.
<string
This is a test\n
This is another line.
/>
Run Code Online (Sandbox Code Playgroud)
当换行符(或下一行开头之前的空格)导致新行缩进1个空格时,我尝试在textview中显示此内容.显示基本上这看起来像 -
这是一个测试
This is another line
为什么会发生这种情况,我该如何解决这个问题?有线索吗?
我想在TabHost中为每个标签显示一个不同的片段.但似乎没有简单的方法可以做到这一点.TabHost只能接受A. Views或B.当用户选择选项卡时启动活动的意图.
使用A意味着我必须初始化每个片段并将它们加载到提供给TabHost的容器视图中.但是我希望这些片段只在需要时加载 - 当用户选择它们的标签时.
使用B表示我将片段加载到每个选项卡的单独活动中.但是我希望片段能够到达"原始"父级Activity,而不仅仅是一些在Tab选项中托管它们的shell Activity.
我错过了什么吗?有没有办法正确管理TabHost片段?
android android-tabhost android-fragments android-3.0-honeycomb
我startActivityForResult()用来允许用户从我的应用程序中选择文件系统中的文件.选择文件后,OnActivityResult()运行并将文件路径保存到变量并继续.这在Android 2.3及更低版本上运行良好.
然而,在Honeycomb上,OnCreate()再次运行OnActivityReult(),基本上重新开始我的活动,所以我无法保存任何变量,因为它在我得到结果后运行一个全新的活动.
知道为什么会这样,我能做些什么呢?
android ×10
android-4.0-ice-cream-sandwich ×2
animation ×1
google-play ×1
java ×1
mobile ×1
publishing ×1
resolution ×1
scrollbar ×1
scrollview ×1