subactivity

onActivityResult sometimes not called when Sub-Activity finishes

六眼飞鱼酱① 提交于 2020-01-01 09:55:17
问题 During testing I noticed that sometimes the finish() of my sub-activity doesn't execute onActivityResult. Most of the times it works okay, and I can't figure out, when and why this problem occurs. Subactivity start: public void launchSubActivity(Class<? extends Activity> subActivityClass, Bundle data, OnSubActivityResult callback) { Intent i = new Intent(this, subActivityClass); if(data!=null) i.putExtras(data); Random rand = new Random(); int correlationId = rand.nextInt(); _callbackMap.put

Third sub activity in a Tab not working due to listview in second

浪尽此生 提交于 2019-12-13 04:28:20
问题 I have a TabInterface.java which hosts five tabs. In one of the tab, I am using subactivities.When I click on the AddBook tab (which extends ActivityGroup) the search book page loads properly. When I click on search button a list of books is generated. When I click on the book, a new page must open but its program is running properly but not displaying any thing on the screen. TabInterface.java public class TabInterface extends TabActivity { super.onCreate(savedInstanceState); setContentView

Activities and sub activities

不打扰是莪最后的温柔 提交于 2019-12-11 05:56:47
问题 My Application has 5 different activities ( name them as A,B,C,D,E ) and there is a menu (made by buttons on bottom of the screen), to switch between A,B...E when I am displaying A, there are some button by which the user goes on another activity A1 on top of A, then from there he goes into A12, so my activity stack is something like A>A1>A12, now the user click on menu button for B, then he goes on B1 from there . (Stack would be like A>A1>A12>B>B1) now if user press the button to switch

How to force main Acivity to wait for subactivity in Android?

你离开我真会死。 提交于 2019-12-10 14:13:43
问题 I am calling a subactivity from main activity. This subactivity should take few numbers from user (i'm using Edit text control to achieve this), save them to static variable in another class and terminate. I want main activity to wait for subactivity but both are just running simultaneously. Even doing sth like that doesn't help: Thread t = new Thread(new Runnable(){ public void run(){ Log.v("==================", "run "+new Date()); startActivityForResult(new Intent(ctx,myCustomSubactivity

Android ==> Sub Activity?

隐身守侯 提交于 2019-12-06 04:06:00
问题 Is it possible to add an activity on top of the current activity. For example lets say i click a button, and then it adds a second activity to the current activity. And the second activity only covers a small place at the buttom of my current activity. 回答1: The activity is just displaying a window, so you can use getWindow() to modify the window params to be what we want -- wrap content instead of fill parent for example. Though for an activity that is not going to be full screen, you should

Using Monkey in a subactivity only (android debugging)

时光怂恿深爱的人放手 提交于 2019-12-04 08:06:07
I'm trying to use Monkey debuggin tool (from adb) to stress test a part of my application. As Monkey acts in a total random way, I'd like it to concentrate on the part of code that might contain an error I'm looking for (very rare bug, and I don't know how to replicate it). So, in my Main activity I have 6 buttons, each fires up a new activity. I'd like to set monkey to look only in one of those activities, and every activity accesible from it. I cannot find a reasonable way to do it. I've tried the adb shell monkey -p my.package.name -c android.intent.category.MONKEY 1000 and in my manifest

onActivityResult sometimes not called when Sub-Activity finishes

人盡茶涼 提交于 2019-12-04 06:27:56
During testing I noticed that sometimes the finish() of my sub-activity doesn't execute onActivityResult. Most of the times it works okay, and I can't figure out, when and why this problem occurs. Subactivity start: public void launchSubActivity(Class<? extends Activity> subActivityClass, Bundle data, OnSubActivityResult callback) { Intent i = new Intent(this, subActivityClass); if(data!=null) i.putExtras(data); Random rand = new Random(); int correlationId = rand.nextInt(); _callbackMap.put(correlationId, callback); startActivityForResult(i, correlationId); } Subactivity finish: public void

Android onActivityResult is always 0

我与影子孤独终老i 提交于 2019-11-27 22:06:13
This has been killing me for two days now. I have a main Activity A which calls a second Activity B. Activity B simply presents the user with a listview. When I press an item on the list view I want a couple of strings to be passed back to the main Activity A and Activiy B will finish. The problem is I always get a resultcode of 0 and the data bundle is null. I really don't understand why this is happening. Here is my code. Start Activity B for result: Test.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(recipeActivity.this,

Android onActivityResult is always 0

自作多情 提交于 2019-11-26 20:54:15
问题 This has been killing me for two days now. I have a main Activity A which calls a second Activity B. Activity B simply presents the user with a listview. When I press an item on the list view I want a couple of strings to be passed back to the main Activity A and Activiy B will finish. The problem is I always get a resultcode of 0 and the data bundle is null. I really don't understand why this is happening. Here is my code. Start Activity B for result: Test.setOnClickListener(new View