我开发了Android应用程序,无法从Market下载到Android ICS设备.使用4.x设备浏览市场时,人们会看到"不兼容的警告",无法继续下载.该应用的minSdkVersion设置为7.它适用于2.x和3.x Android设备.我不知道该怎么办以及如何解决这个问题.我是否需要设置任何特殊的东西才能与ICS兼容?我找不到有关此主题的任何信息.
更新:我刚刚收到确认,手动安装APK适用于4.0设备.它只是不会通过市场安装!同样,它在市场上显示为"与您的设备不兼容".有任何想法吗?
AndroidManifest.xml中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nl.tmd.natuurijs"
android:versionCode="7" android:versionName="1.1.3">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name=".NatuurijsApplication"
android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" android:required="false"/>
<!-- Main Activity -->
<activity android:name=".MainActivity" android:label="@string/app_name"
android:theme="@style/NatuurijsTheme" android:launchMode="singleTask" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="natuurijs" android:host="main" />
</intent-filter>
</activity>
<!-- Map Activity -->
<activity android:name=".NatuurijsMapActivity" android:label="@string/app_name"
android:theme="@style/NatuurijsTheme" …Run Code Online (Sandbox Code Playgroud) 我有一个通常是的ListView singleChoice choiceMode.当用户长按项目时,我想进入允许选择多个项目的动作模式,以便他们可以对任何选定的项目执行操作.
我能够配置它ListView以使其处于singleChoice模式,并且用户能够选择列表项以在其旁边显示细节片段并使列表项本身显示为其激活状态.
我也能够配置它ListView以便multipleChoiceModal choiceMode在项目中执行长按并启动动作模式并允许多个选择,但现在ListView将不允许在正常模式下进行单个选择(无动作模式).
如何处理singleChoice模式中的ListView,然后multipleChoiceModal在长按项目时将其转换为模式?
这是我能够提出的最接近的:
singleChoice模式OnItemLongClickListener并在该侦听器中:
OnItemLongClickListener为nullchoiceMode为multipleChoiceModalview.performClick()长按的项目.这种方法有几个问题.
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);,onDestroyActionMode我得到一个java.lang.StackOverflowError因为该方法最终也试图破坏动作模式(但我们还没有从破坏中返回).android android-3.0-honeycomb android-4.0-ice-cream-sandwich
我将为用户提供我的ICS平板电脑以完成调查,因此我希望用户仅使用我的应用程序.他们不应该切换到主屏幕,按后退按钮等,所以我想完全隐藏系统栏.
我的平板电脑扎根,我知道像一些应用程序 这可以帮助我,但我并不需要这个应用程序的所有附加功能.
我发现这个教程可以帮助我,但是如果我可以添加代码来做我自己的,那就太棒了.
android fullscreen kiosk-mode android-4.0-ice-cream-sandwich
我写了一些服务,使用BroadcastReceiver来捕获媒体按钮之一(来自耳机的"播放按钮"),它在Android 2.3.x(HTC Nexus One或HTC Desire)上运行完美
当我试图在Android 4.0.3(三星Nexus S)上运行它不起作用(我的应用程序没有收到意图"android.intent.action.MEDIA_BUTTON"和"播放"按钮表现如常:停止/启动音乐).
清单内容:
Run Code Online (Sandbox Code Playgroud)... <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <receiver android:name=".buttonreceiver.MediaButtonIntentReceiver" > <intent-filter android:priority="10000" > <action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter> </receiver> ...
有没有办法让它在android 4.0.3上运行
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_and_activation_view);
Log.d("MR", "onCreate - " + getIntent().getAction());
mReceiver = new MediaButtonIntentReceiver();
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_MEDIA_BUTTON));
}
Run Code Online (Sandbox Code Playgroud)
现在我完全糊涂了.
android broadcastreceiver android-manifest android-4.0-ice-cream-sandwich
我的应用程序调用库的意图如下:
Intent intent = new Intent(Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, SELECT_IMAGE_FROM_GALLERY);
Run Code Online (Sandbox Code Playgroud)
在<3.0版本中没有问题.
对于3.0及更高版本,当您获得本地图像时,onActivityResult方法中的意图包含类似于Uri的...
content://media/external/images/media/XXX
Run Code Online (Sandbox Code Playgroud)
但是当你选择一个picasa图像时,uri就像......
content://com.google.android.gallery3d.provider/picasa/item/XXXXXXXXXXXXXXXXXXXXX
Run Code Online (Sandbox Code Playgroud)
我读了很多关于这个问题的文章,我尝试了很多解决方法.
目前,我可以使用以下方法获取缓存的图像:
getContentprovider().openInputStream(uri)
Run Code Online (Sandbox Code Playgroud)
问题是,当图像没有被缓存时,openInputStream(uri)方法抛出一个FileNotFoundException,我无法获取图像:_(
任何人都知道如何获取文件或网址下载文件或东西来获取图像?
谢谢!!
android picasa gallery android-3.0-honeycomb android-4.0-ice-cream-sandwich
我正在尝试创建一个自定义对话框,基本上我正在使用,DatePickerDialog.THEME_HOLO_DARK但我想更改"分隔符"颜色和文本颜色.

我想将蓝线和文字颜色更改为红色.
提前致谢!
编辑:
使用此代码:
<style name="testo" parent="@android:style/Widget.DeviceDefault.DatePicker">
<item name="android:divider">@drawable/dialog_divider</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这就是我得到的:

分隔器的抽屉基本上是红线..
我正在寻找针对此报告中描述的z-index错误的变通方法或polyfill:http: //code.google.com/p/android/issues/detail?id = 31862
我的标记和CSS看起来与bug报告中给出的基本相同.
如果有人能给我一个如何解决这个问题的正确方向的提示,真的很棒.
我正在编写一个Android ApplicationTestCase(来自Diego T. Milano的Android应用程序测试指南中的TemperatureConverterApplicationTests示例,第171页).这个例子是针对Android 2.3编写的,它似乎不适用于Android 4.你不必知道这本书来理解这个问题,因为我简化了它.
这适用于Android 2.3.3(API 10):
setContext(new MockContext());
createApplication();
Run Code Online (Sandbox Code Playgroud)
[确切地说,抛出了UnsupportedOperationException,因为没有实现getPackageName().但这是正常的,可以通过使用实现getPackageName()和getSharedPreferences()的MockContext()子类来解决.这是不相关的,因为即使这样做之后问题仍然存在.]
问题是,使用Android 4.1.2(API 16)它不起作用.我得到一个AssertionFailedError,通过一些调试我发现是由于在ApplicationTestCase的第100行抛出了ClassCastException.
mApplication = (T) Instrumentation.newApplication(mApplicationClass, getContext());
Run Code Online (Sandbox Code Playgroud)
的ClassCastException异常信息是:
java.lang.ClassCastException: android.test.mock.MockContext cannot be cast to android.app.ContextImpl
Run Code Online (Sandbox Code Playgroud)
任何建议为什么会发生这种情况以及如何避免?
Fragments API发布后,我开始使用兼容包将所有已弃用的对话框移植到DialogFraments中.一切都运行良好,直到我注意到我的对话框仅导致ICS崩溃:
E/AndroidRuntime( 883): FATAL EXCEPTION: main
E/AndroidRuntime( 883): java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
E/AndroidRuntime( 883): at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1254)
E/AndroidRuntime( 883): at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1265)
E/AndroidRuntime( 883): at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:541)
E/AndroidRuntime( 883): at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:525)
E/AndroidRuntime( 883): at android.support.v4.app.DialogFragment.show(DialogFragment.java:123)
E/AndroidRuntime( 883): at com.myapp.ui.dialogs.TwoButtonDialogFragment.showDialog(TwoButtonDialogFragment.java:84)
Run Code Online (Sandbox Code Playgroud)
我的对话框显示在AsyncTask.onPostExecute()上,以显示对用户的http响应.在深入研究问题之后,我得出的结论是,只有当Activity暂停或停止时才会发生此异常,并且在其他版本的Android上不会发生此异常.我已经尝试使用commitAllowingStateLoss(),但它没有帮助,因为在DialogFragment.show()上抛出了异常.这是我的DialogFragment代码:
private static void showDialog(FragmentActivity activity, String title, String msg,
String positiveButtonText, String negativeButtonText, int id, Bundle args) {
if (activity.isFinishing()) {
return;
}
FragmentManager fmgr = activity.getSupportFragmentManager();
FragmentTransaction ft = fmgr.beginTransaction();
Fragment prev = fmgr.findFragmentByTag(TAG);
if (prev != …Run Code Online (Sandbox Code Playgroud) android android-fragments android-4.0-ice-cream-sandwich android-dialogfragment
我有一个在Manifest注册的广播接收器:
<application ...>
<receiver android:name="com.some.pkg.NewAppReceiver" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
</intent-filter>
</receiver>
</appcication>
Run Code Online (Sandbox Code Playgroud)
和接收器:
public class NewAppReceiver extends BroadcastReceiver {
private static final String TAG = "NewAppReceiver";
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Intent: " + intent.getAction());
}
}
Run Code Online (Sandbox Code Playgroud)
当我手动或从Android Market安装APK时,没有收到任何内容.为什么?
android ×10
android-4.0-ice-cream-sandwich ×10
css-position ×1
datepicker ×1
fullscreen ×1
gallery ×1
java ×1
kiosk-mode ×1
picasa ×1
z-index ×1