Android :: Start An Activity In Another Package
Jan 25, 2009
My application has 2 packages because one is shared with my other applications. I want to start an activity of the shared package.
I tried the following: Intent intent = new Intent(); intent.setClassName(shardedPackageName,sharedActivityName); startActivity(intent);
It throws an ActivityNotFoundException and suggests that the activity might not be in the manifest. But how do I list an acitivity from another package in the manifest?
View 5 Replies
Jun 9, 2009
I have a service class my.app.MyService that I'm attempting to launch from my.app.MyActivity as follows:
Intent svc = new Intent( this, MyService.class );
The manifest contains the entries:
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
<service android:name =".MyService" />
LogCat gives the message:
"Unable to start service Intent { comp={"my.app/ my.app.MyService" } } : not found"
Could someone kindly let me know what I am missing?
View 3 Replies
View Related
May 6, 2010
I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example)
I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to.
I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually.
CODE:..................
View 2 Replies
View Related
Apr 25, 2010
I have two apps, one runs in namespace com.gtosoft.voyager and the other is com.gtosoft.dash. From com.gtosoft.dash I would like to start up the service which is defined in com.gtosoft.voyager...
I think I need an intent, but what arg(s) would I pass to the intent before kicking it off with startService()?
If they were in the same package I could just use
CODE:............................
View 1 Replies
View Related
Aug 6, 2010
Can someone tell me how to start new application knowing only its package name? I do not have information about what activity is the main one.
View 1 Replies
View Related
Jan 26, 2009
I have an application with contains multiple activities. The main activity will start the others ( use startActivity() ) depends on user event, when an activity close, it calls finish() and return back to main activity. It appears to behavior like that.
However, the "problem" I see is main activity's onCreate function is called every time. I think the the main activity should be placed in the activity stack and simply push to front when others exit, therefore only onResume, onStart are called. Is there some flag I need to set or I misunderstand the activity behaviro?
In child activity, besides calling finish() or startActivity for main activity, what is other way to move main activity to front?
View 2 Replies
View Related
Jan 10, 2010
I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).
I tried to enabled it the following way:
CODE:...........
This is the method from main activity. When onPause() is executed isRunningInBackground is set true.
When I tried to debug it when the main application was running in the background the line
startActivity(intent) had no effect (the activity didn't appear).
Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?
View 1 Replies
View Related
Apr 20, 2010
I have tried to write an Android application with an activity that should be launched from a different application. It is not a content provider, just an app with a gui that should not be listed among the installed applications. I have tried the code examples here and it seems to be quite easy to launch existing providers and so on, but I fail to figure out how to just write a "hidden" app and launch it from a different one.
The basic use case is:
App A is a normal apk launchable from the application list.
App B is a different apk with known package and activity names, but is is not visible or launchable from the application list.
App A launches app B using the package and class names (or perhaps a URI constructed from these?).
I fail in the third step. Is it possible to do this?
View 3 Replies
View Related
Sep 10, 2010
I need to made an activity (without layout) that on start check if a service is running. if it is true it starts Activity2, if it false it starts Activity1.
I tried with this code:
CODE:............
Enter code here
But when I check, in the onCreate method, if serviceConnect!=null I receive sometime a NullPointerExcption.
I tried also to insert the operation in the method onCreate in an Async Task:
CODE:............
View 2 Replies
View Related
Apr 22, 2010
I have a huge maze of activities in my application. What I need to do, is that when the user logs in into the system, the activity history should be cleared. I cant just use finish() when I start a new activity, because I want the activities to have a history until the user logs in. I have experimentet with the different flags when starting an activity, but I have had no success.
View 1 Replies
View Related
Mar 25, 2010
I have the code to get the list of packages installed in phone. I have represented the list in the form of Array List, below is the code snippet. But upon clicking in the package name I want to start that application, but how do I get the respective class name and package name to run? Is there any other method which I can try to start an application? arrayList<String> PackageNames = null; List<PackageInfo> lis = pm.getInstalled Packages(GET_MINIMAL); Pkgs = (ListView) findViewById(R.id.package_list); for (Package Info pi : lis)packages.put(pi.packageName, pi); PackageNames = new ArrayList<String> packages.keySet()); Collections.sort(PackageNames); PackageNames.add(0, "All"); pgs.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple _list_ item_1, PackageNames)); Pkgs.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View v, int pos,long rowId) { Intent i = new Intent(); i.setComponent(new ComponentName(class name,packagename)); startActivity(i); I have tried intent to start the activity, but don't know the class name and package name to pass in the ComponentName() to start activity.
View 2 Replies
View Related
Feb 25, 2009
I have 5 activities in my project. How can i check the condition of 2nd activity from 4th activity? Based upon this condition i want to do something. If anybody know this please tell me. Am waiting for the response.
View 2 Replies
View Related
Nov 19, 2010
I want to start a new activity from ab activity that (extends from Linearlayout) .. but this code is not right
CODE:..........
public class SearchResultForm extends LinearLayout{ ...
And i get this error ..
No enclosing instance of the type SearchResultForm is accessible in scope.
View 4 Replies
View Related
Aug 19, 2009
An activity can be called from existing activity through *startActivity(intent); *
Is t possible to call an activity from non Activity class ? and how?
View 2 Replies
View Related
Jun 19, 2010
i'm a bit stuck with remote services in android. thing is i implemented a remote service in package "a.b.c" and i want other applications to be able to access this service. i got rid of the whole crappy aidl-stuff and designed the "interface" of the service to work via broadcasted intents. works fine so far...
problem is: how do i get a different application (different package, different project, maybe even a different developer, ...) to start/stop the service?
CODE:..........
This will crash my app immediately on startup. what did i do wrong? how will i get this to work?
once it's running, commands and data will be passed via broadcasts. so that should be no real problem...
View 1 Replies
View Related
Aug 16, 2009
I want my background service to determine the active package or activity running.Is this possible?
View 4 Replies
View Related
Apr 8, 2010
I am developing an aplication. This one is designed to login a user, then select how find a place, using simple data or using a map. When I try to set in the event OnClick for select the "Map way" (using intent):
startActivity(new Intent(getApplicationContext(), MapviewController.class));
I have problems and didn't work.
My class and manifest are:
CODE:...........
Do you know any way to call the MapActivity from other?
View 3 Replies
View Related
Jan 5, 2010
I am working on a travelling application and i am using tabs and each tab has an activity i.e world clock in one tab ,weather data in another tab and so on with in the weather tab i am displaying the users selected cities and the scenario is that when the user selects a city that city's forecast is to be displayed and later to view details as well which is in another activity . how can i launch this new activity from the already started activity with in the same tab ?
View 4 Replies
View Related
Sep 13, 2010
I'm trying to start an Activity with startActivityForResult, but I keep getting an ActivityNotFound exception, and I can't work out why. I've looked through the code multiple times, and it seems to be identical to some other, working code. Any suggestions?
The newNoteButton that starts the Activity:
CODE:...........
And the beginning of the TypyEdit Activity:
CODE:................
View 1 Replies
View Related
Sep 15, 2010
I have created two classes: Example1 and Example2, which extends activity.
Example1 contains a UI of buttons, while Example2 contains UI of TextEdit.
I want to call Example2 when a button is clicked, so this code is in an onclick method
Intent i = new Intent();
i.setClassName("com.a.ui", "com.a.ui.Example2");
startActivity(i);
So I am able to get the UI of Example2 successfully.
What's an alternate way of calling intent?
Is there any alternate way to start an activity?
View 2 Replies
View Related
Jun 25, 2010
I'm trying to do some dynamic code and I load a new class that's supposed to be an Activity and I want to start it, but using the regular startActivity(Intent) wants the Activity to be "Declared" in the AndroidManifest.xml file.
View 1 Replies
View Related
Feb 21, 2010
I am trying to make a PopupWindow show straight away when an activity has started.
when calling public void showAtLocation (View parent, int gravity, int x, int y)
I get the exception ERROR/AndroidRuntime(2500): Caused by: android.view.WindowManager $BadTokenException: Unable to add window -- token null is not valid; is your activity running?
At the moment I am calling from onCreate, but when calling from onStart or onResume it still gives the same error.
The activity api says the activity is supposed to be running after onResume is called. Where is the best place to load up the PopupWindow if it needs to be done straight away?
At the moment It looks like Activity.onWindowFocusChanged() is the best place.
View 2 Replies
View Related
Jan 22, 2009
I create my Network provider and I want to start Activity from it. Is it necessary to create separate Activity with Manifest and then launch it using startActivity? Can I launch unregistered Activity directly from my provider?
View 5 Replies
View Related
Sep 3, 2010
I have a launcher activity which gets activated everytime i start the application and a service which complements it. Now as i press the return key from my main activity .Its Ondestroy gets called.Now i have nullify the pointer of the my launcher activity there. now i am listening through the service any event happening on the network after closing the launcher activity thread and if any event occurs i have to relaunch my launcher activity. i have tried intent but doesnot seems to get though it .
View 4 Replies
View Related
Feb 21, 2010
I want to know if there is any way to start another application from within my application. Specifically i am trying to a have a shortcut (button) to Google Maps Application within my application. Also is there any way to start another process from within my android appplication?
View 4 Replies
View Related
Jun 2, 2009
I want to start the activity owned by other application. I know we could construct the Intent(setAction,setClass), and then call context.startActivity(intent) to start a new activity owned by the same application. When we start the activity not owned by the same application,doest this also work?
For example, I have a activity (com.test.StartTest) and there is a button that used to start some activity Settings owned by the Phone:
CODE:..............
View 3 Replies
View Related
Oct 6, 2010
I have a service (input method) and from within that service I want to start and activity which was declared in the same manifest. The activity maybe running but in the background.
How do i check its presence and bring it to front, or optionally start this.
From what I can gather from other posts, this is about what I need to do:
CODE:..............
I don't knwo which of thest flags pertain to what I need to do. The docs are quite merky, and my random attempt at making this work failed.
View 4 Replies
View Related
Aug 4, 2009
How can i start my own activity when a new notification arrives to our status bar if click that notification my activity should play...
View 4 Replies
View Related
Oct 16, 2009
My application has a background process which continuously waits on a socket for receiving messages and it should be started only once and at the time of application starting.Thus i want to do that background job in a service.
The service should not be started from the activity ,it should be started at the application starting.
How can i define the service,which will be started at the time of application starting?
If at all the service is started from activity.The activity can be destroyed and restarted.when this happens the service also be restarted .
View 7 Replies
View Related
Jul 31, 2010
In a broadcast receiver I want to do the following:
1. See if MyActivity is alive somewhere. 2. If it is, bring it to the foreground. 3. Otherwise, start a new MyActivity.
View 3 Replies
View Related