[android-developers] Calling Activity from Service
Hi, I want to call an Activity A from a Service in Android(and pass some Strings to it). This activity A inturns calls another activity B with startActivityForResult(). Basically, I want my service to wait till the result from activity B is obtained. Please give me some idea of how this implementation can be done(and which flag to set in intent)? Service: Intent intent = new Intent(getBaseContext(),ActivityA.class); intent.putExtra(code,script); intent.putExtra(type, type); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); ActivityA: Intent intent = new Intent(this,ActivityB.class); intent.putExtra(code,code); intent.putExtra(type, type); startActivityForResult(intent,REQUEST_CODE); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Calling Activity from Service
On Thu, Oct 25, 2012 at 3:28 AM, Archana ramalingam.arch...@gmail.comwrote: Basically, I want my service to wait till the result from activity B is obtained. Please give me some idea of how this implementation can be done(and which flag to set in intent)? There isn't really a concept of start activity for result from a Service. What you can do is restart the Service after the Activity Result with a new Action type or flag within the Intent to indicate that it's for processing a result. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Calling Activity based on Content wrapped in a Activity
On Sat, Feb 4, 2012 at 11:35 PM, Abhishek Singh singh.abhi4...@gmail.comwrote: now i want 1 of those activity to be started only when the text content starts with '@@'and other one for any general text/plain should launch it. how can i do this.??? That's probably a little too specific for Intent Filters. You could have you generic activity that response to anything that first checks the data on getting the Intent. If it starts with @@, it starts the specific activity and closes itself, otherwise continues to process. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling Activity based on Content wrapped in a Activity
Hi... I m Developing 2 activities both of them should be fired when the mimeType is text/plain as shown below.. intent-filter action android:name=android.nfc.action.NDEF_DISCOVERED / category android:name=android.intent.category.DEFAULT / data android:mimeType=text/plain / /intent-filter now i want 1 of those activity to be started only when the text content starts with '@@'and other one for any general text/plain should launch it. how can i do this.??? Thanks in Advance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling Activity 4m Fragment
Hi I need to call the activity from a fragment, The following code is not working public class MyFragment extends Fragment{ *switch*(number){ *case* 1: Intent intent = *new* Intent(*this*.getActivity(), ActivityOne.*class*); *startActivityForResult*(intent); *break*; *case* 2: Intent intent = *new* Intent(*this*.getActivity(), ActivityTwo.*class*); *startActivityForResult*(intent); *break*; *case* 3: Intent intent = *new* Intent(*this*.getActivity(), ActivityThree.*class*); *startActivityForResult*(intent); } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] calling activity from alertdialogbox
Hi to all...can one tell me .how to call a activity from alert dialog box -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] calling activity from alertdialogbox
On Wed, Jul 27, 2011 at 6:42 AM, rambabu mareedu rambabu.mare...@gmail.comwrote: how to call a activity from alert dialog box You may need to elaborate ... it's the same way you call it from anywhere else. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] calling activity from alertdialogbox
thankQ..so i can use intent in the alertdialog box..,am i right On Wed, Jul 27, 2011 at 7:18 AM, TreKing treking...@gmail.com wrote: On Wed, Jul 27, 2011 at 6:42 AM, rambabu mareedu rambabu.mare...@gmail.com wrote: how to call a activity from alert dialog box You may need to elaborate ... it's the same way you call it from anywhere else. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] calling activity from alertdialogbox
On Wed, Jul 27, 2011 at 9:20 AM, rambabu mareedu rambabu.mare...@gmail.comwrote: so i can use intent in the alertdialog box..,am i right Try it, see what happens. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling activity from Stub
Hi all, I have a class extending IPackageManager.Stub (does not really matter here), the point is, I need to start an activity from this class. I cannot do: Intent i = new Intent(); i.setComponent(new ComponentName(packageNameString, fullyQualifiedClassNameOfActivity )); startActivity(i); as my class is not an activity. How can I do that? Btw i know I can pass the instance of the calling activity of the non-activity class as a parameter, but I need something else for design purposes. So, to be clear, How can I call an activity from a non-activity class? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] calling activity from menu
Hi, I have a menu item which when selected would call another activity class. I am using switch case to select between menu items. I tried creating an Intent to start activity using the Class name but doesn't work. please help. Thanks, mithun -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Calling activity from Stub
On Sat, Jan 8, 2011 at 6:48 AM, Tux guillaume.ben...@gmail.com wrote: So, to be clear, How can I call an activity from a non-activity class? You answered your own question: Btw i know I can pass the instance of the calling activity of the non-activity class as a parameter, but I need something else for design purposes. Rethink your design. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Calling activity from Stub
If you have a Context reference in this code, you can call: myContext.startActivity(...) Might want to set FLAG_ACTIVITY_NEW_TASK flag in the intent to avoid a logcat warning when it's added by the framework. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 14.01.2011 16:21 пользователь Tux guillaume.ben...@gmail.com написал: Hi all, I have a class extending IPackageManager.Stub (does not really matter here), the point is, I need to start an activity from this class. I cannot do: Intent i = new Intent(); i.setComponent(new ComponentName(packageNameString, fullyQualifiedClassNameOfActivity )); startActivity(i); as my class is not an activity. How can I do that? Btw i know I can pass the instance of the calling activity of the non-activity class as a parameter, but I need something else for design purposes. So, to be clear, How can I call an activity from a non-activity class? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] calling activity from menu
On Thu, Jan 13, 2011 at 12:13 AM, mithun hr mithun.hallik...@gmail.comwrote: I tried creating an Intent to start activity using the Class name but doesn't work. please help. Please explain what doesn't work means. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] calling activity from service
hi.. i am writing an app in which i need a background service to call an activity and show some result.. pls share some example.. thnx a lot.. kartik.. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
RE: [android-developers] calling activity from service
You should be able to do it the same way you would call it from any other activity. Only before you call startActivity be sure to set the FLAG_ACTIVITY_NEW_TASK setting like below: Intent beginActivity //so on beginActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(beginActivity); I think thats how I did it in my code. I am not infort of that PC right now to confirm though. Hopefully this will help. Tommy -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Kartik Bansal Sent: Friday, November 19, 2010 1:32 PM To: Android Developers Subject: [android-developers] calling activity from service hi.. i am writing an app in which i need a background service to call an activity and show some result.. pls share some example.. thnx a lot.. kartik.. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling Activity
Hello , I have a broadcast class that blocks the incoming call. I want to call that broadcast receiver from the activity . Can any one help me fix this. I appreciate your help. 1. Class A extends activity will call Class B that extends BroadcastReceiver, now I want to block calls , only based on certain requirements, which are checked in Class A, if true then call the Class B (or block the call in short) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Calling Activity
On Fri, Jul 9, 2010 at 10:00 AM, ranjan ar ranjan@gmail.com wrote: Can any one help me fix this. Fix what? You've loosely outlined what you want to do, but not what problem you're actually having. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling activity from inside a thread?
Hi, I want to either use WiFiManager to toggle wifi from inside a thread or call another activity to do this, whichever is possible. I tried using the wifimanager class inside the thread but it didn't work. Could anyone tell me how to call an activity using Intents from inside a thread? Thanks, Abhi -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en