activity

Android - Performing stop of activity that is not resumed

匿名 (未验证) 提交于 2019-12-03 02:51: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

Android: Launch mode 'single instance'

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was going through the documentation for single instance and was trying out few samples. In one of my sample I have three activities: A->B->C , where B has android:launchMode="singleInstance" in manifest. Activity A and C has default launch mode. Scenario: After navigating to C via A and B (i.e A->B->C), back button press from Activity C takes to Activity A (C->A), but back button press from Activity A does not quit the app, rather brings the Activity B to front, then back button press from Activity B quits the app. Question Why does

Task and Activity stack : what is difference between both.

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I followed some tutorials but got confused with "Activity stack" and "Task". Because both starts when a new activity is created. Activity stack keeps a navigation history of activities, and Task is a sequence of activities. Is this is only difference that Activity stack made up of one or more task(S)? Give some example please. 回答1: Activities and Tasks As noted earlier, one activity can start another, including one defined in a different application. Suppose, for example, that you'd like to let users display a street map of some location.

Getting Permission Denial Exception

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an activity in my app that allows the user to select several files from the device one by one, I am using an intent like this: Intent intent = new Intent (); intent . setType ( "*/*" ); intent . setAction ( Intent . ACTION_GET_CONTENT ); startActivityForResult ( Intent . createChooser ( intent , getString ( R . string . select_attachments_activity_chooser_label )), SELECT_PICTURE ); This is working perfectly fine, I am getting the Uri's of the files selected, they look like this: content : //com.android.providers.media

Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes - Android studio 2.0 beta 6

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I updated to the last version of Android studio 2.0 Beta 6 with the gradle : dependencies { classpath 'com.android.tools.build:gradle:2.0.0-beta6' } The app works perfectly fine on emulator and devices I tested every thing and it works fine. I got many errors only when I try to Generate Signed APK, I got some errors in dependencies, all of them solved when i excluded vector drawable, vector animate drawable and Support-v4 library Now i dont have any dependencies error. now my gradle.build for the app module looks like this: apply plugin:

Android 4.4.2 - java.lang.RuntimeException: Performing stop of activity that is not resumed

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting this exception on a 4.4.2 device. Not reproducible on Android 4.3 device or lower. Setup is I have a home activity (subclass of support ActionBarActivity ). The home activity checks a boolean flag, and if true, launches a splash screen activity (yes, ideally the splash comes before the home activity, but let's assume I can't change it to work that way for now). The splash screen is launched with startActivityForResult , it downloads some config options from the server, then finishes and returns the result back to the home

Can Honeycomb Loaders solve problems with AsyncTask + UI update?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Doing something in background and then updating UI is very hard to implement correctly in Android. It's simply badly designed. Typical example is an AsyncTask that fetches something from the web and displays the result. There are 2 problems with this: The AsyncTask has a reference to Activity (because it needs to update its UI). After screen orientation change, the Activity is restarted. But the AsyncTask still references to the old destroyed Activity therefore it can't update the UI of the new Activity. This can lead to OutOfMemoryException

Properly skip login activity if already logged in

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My launcher icon currently starts the login activity. I've stored the logged in status in SharedPreferences. Is there any way to properly skip the login activity and go straight to the main activity without any UI glitches. All existing solutions involving finish() in onCreate() cause the login activity title to be briefly visible or some other brief blank screen UI glitch. 回答1: Have a launcher acitivy with no UI that decides to open the MainActivity or the LoginActivity. You can declare no UI with: android:theme="@android:style/Theme

How to show activity indicator while tableView loads?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: When I switch between my tabs it loads some seconds and I want to know that my data is loading. For that I decided to add an activity indicator. I wrote a little function: func showActivityIndicator () { dispatch_async ( dispatch_get_main_queue ()) { self . spinner = UIActivityIndicatorView ( activityIndicatorStyle : . WhiteLarge ) self . spinner . frame = CGRect ( x : 0.0 , y : 0.0 , width : 80.0 , height : 80.0 ) self . spinner . center = CGPoint ( x : self . loadingView . bounds . size . width / 2 , y : self . loadingView .

Android: How do I avoid starting activity which is already in stack?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Lets try to explain my question: I got an application and a service. The application is started with activity A. The service sends a broadcast that will let the application start Activity B Now the user starts activity C. Now the service wants to start activity B again. But how do I let him know that the activity is still on the stack, or is there an intent flag for this? How do I avoid that it will launch activity B because its already in the stack? 回答1: I think you need to make your activity B singleInstance that if it's already create you