activity

Android error: java.lang.IllegalStateException: trying to requery an already closed cursor

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: environment (Linux/Eclipse Dev for Xoom Tablet running HoneyComb 3.0.1) In my app I'm using the camera (startIntentForResult()) to take a picture. After the picture is taken I get the onActivityResult() callback and am able to load a Bitmap using a Uri passed via the "take picture" intent. At that point my activity is resumed and I get an error trying to reload the images into a gallery: FATAL EXCEPTION: main ERROR/AndroidRuntime(4148): java.lang.RuntimeException: Unable to resume activity {...}: java.lang.IllegalStateException: trying to

Automatically log Android lifecycle events using ActivityLifecycleCallbacks?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to automatically capture and log Android lifecycle events using ActivityLifecycleCallbacks, however documentation on this matter is scarce, to say the least: public void registerActivityLifecycleCallbacks (Application.ActivityLifecycleCallbacks callback) I don't want to have to extend the Activity class or override the existing lifecycle methods (onCreate, onResume, etc...) I'm looking to have a separate class listening for these events and acting accordingly. Does anyone have any experience in this, or have links to good solid

When has the Activity finished drawing itself?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This maybe somewhat of a strange question but I just can`t figure it out. Basically I have a class that extends View and overrides the onDraw method so it draws a bitmap what it is called. What I want to do is when by choosing a picture from a gallery, send it through and intent and draw that on the View. The problem is that I can`t get the Activity to draw the bitmap when it is started. I try setting in in onCreate, onStart... nothing works. It works if I set the bitmap on a button press and calling invalitate(), so I suspect that I try to

Activity has leaked IntentReceiver that was originally registered here. Are you missing a call to unregisterReceiver()?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 01-16 16:52:42.211: E/ActivityThread(2529): Activity com.Civilcourage.CivilcurageSplash has leaked IntentReceiver com.google.android.gcm.GCMBroadcastReceiver@405282e0 that was originally registered here. Are you missing a call to unregisterReceiver()? What is the cause of the above error? How can it be avoided? 回答1: Don't rely on onStop() , because : Note that this method may never be called, in low memory situations where the system does not have enough memory to keep your activity's process running after its onPause() method is called More

Get activity instance

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Excuse me for simple question,I'm completely beginner java and android developer. How I can get the instance of Activity in setCameraDisplayOrientation when surfaceChanged is called? public class MyActivity extends Activity { private Camera mCamera; private CameraPreview mPreview; public final int cameraId = 0; public Activity activity = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); activity = this; // Create an instance of Camera mCamera =

Android: Start Activity from preferences.xml

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to start an Activity from a default preferences.xml, with < intent > tag. The Activities are well tested, the problem is not with that. (I'm extending PreferenceActivity in my app, so the preferences.xml is "comes" with that) Please look at the code, what's wrong? preferences.xml: .... <PreferenceCategory android:title="@string/titleEtcSetup"> <PreferenceScreen android:key="renameCourses" android:title="@string/titleRenameCourses" android:summary="@string/textRenameDisplayedCoursesNames"> <intent android:action="android.intent

Android - Performing stop of activity that is not resumed

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I push my app to background, and do some other stuff like whatsapp or sms, onResume it works great. But I recently discovered that when I open/launch facebook app while my app is on background, I don't know what happens... But onResume, the app misbehaves... Don't do what it is required to do, but when I go back to homepage and come back it works fine Please help me out.. how to fix it ??? Logcat with all messages (without filter) 10-15 12:53:59.899: I/Adreno-EGL(32033): Remote Branch: quic/LNX.LA.3.5.1_RB1.1 10-15 12:53:59.899: I

Error type 3 Error: Activity class {} does not exist

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an INTELIJ(v12) android project successfully imported to AndroidStudio(v0.4.0). It works perfectly if I don't change anything in manifest. When I want to change the launcher activity and run, it outputs with the following error: Launching application: com.trackingeng/LandingActivity. DEVICE SHELL COMMAND: am start -D -n "com.trackingeng/LandingActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.trackingeng

Close application and remove from recent apps/

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know this question is common and asked many times on Stack Overflow, but after visiting nearly the four pages of search engine results and nearly the 20 question of Stack Overflow regarding this issue, I found that none of them is resolved or answered correctly. What I want: I want to show my app in recent apps list when it is running but when I close app then my process should be killed and application should be removed from recent apps list. Some answers I found: use System.exit(0); //doesn't clear app from recents OR use android.os

Ask for password before uninstalling application

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: First of all, I have researched a lot about my issue, but I could not find a proper solution so I am posting my query here. Hope to get a better solution to the issue: I have a requirement where I need to ask for password to the user before user deletes my app from settings or from any other application like MyAppSharer. I have found one solution where I can successfully be able to call my activity when user clicks on Uninstall button. I have applied trick here, and calling service. In service, I run timer which runs every 1 second