Android :: Determine If A Specific Activity In An Application Can Be Launched

Jun 9, 2010

Applications can have any number of launchable activities. I know how to get the list of these activities via PackageManager.

Is there a way to determine which activities can be launched via startActivity?

For example, the Documents To Go app has different activities that will start Word, Excel, Powerpoint, PDF, etc... I am able to launch all o these just fine.

However, it also contains some activities that I am not able to launch with startActivity... If I attempt to do this I get a SecurityException.

I want to be able to determine which activities I can safely launch and which I cannot so I only present the user with a list of activities that I can safely launch from within my application...

Android :: Determine if a specific activity in an application can be launched


Android :: Get Instance Of The Launched Activity

Jul 19, 2010

Is there any way to get the instance of a launched activity(or any view in that activity )of a application in another application.

View 1 Replies View Related

Android :: Recieveing A Notification When An Activity Is Launched

Jun 30, 2010

Is there a way of recieving a notification of some sort when a activity is launched. I'd like to monitor which applications are used and how often. Is is possible to register for some broadcast telling me when an application is launched, installed, unistalled etc? I believe I found a discussion or solution to this yesterday when I was looking for something else, but I'm not able to find it today.

View 3 Replies View Related

Android :: BroadcastReceiver To Listen For Activity Being Launched

Jun 22, 2010

I am wondering whether is possible to use a BroadcastReceiver to listen for an Activity being launched. I have no control of the Activity I need to know about as it is from the Android platform.

View 3 Replies View Related

Android :: Detect When Another Activity Is Launched Or Loses Focus

Dec 3, 2009

Like the title says, I need to detect when my app loses focus because another app is launched (Phone call comes in, or user hits Home etc.).
Overriding Activity.OnStop does not work because that is called even when switching activities within my app.

View 3 Replies View Related

Android :: Task Activity Stack Always Reset When Launched From Home

Mar 24, 2009

I am just starting on an Android app and I am puzzled about why my Task activity stack is being reset any time the application is launched from the Home screen. I used the ADT tools to create the application in Eclipse. The main activity is ".UserLaunch" and it starts the activity ".About" when the user presses a button. If the user then presses HOME and then relaunches the app, .UserLaunch is displayed and is the only thing on the stack.

.UserLaunch has the launchMode singleTask. .About is standard. According to the documentation at http://developer.android.com/guide/topics/fundamentals.html#lmodes: "However, a "singleTask" activity may or may not have other activities above it in the stack. If it does, it is not in position to handle the intent, and the intent is dropped. (Even though the intent is dropped, its arrival would have caused the task to come to the foreground, where it would remain.) "The Task stack should be brought to the foreground and .About should still be displayed. I added Logging to all of the lifecycle events (edited to remove timestamps and shorten DEBUG/ and INFO/ to D/ and I/) and you can see that when HOME is pressed, .About cycles through onPause and onStop (as expected). Then when the app is again launched, .About is destroyed and .UserLaunch is restarted D/UserLaunch:(670): onCreate() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.UserLaunch: 4910 ms I/ActivityManager(52): Starting activity: Intent { comp= {com.cequint.cityid/com.cequint.cityid.About} } D/UserLaunch:(670): onPause() D/About(670): onCreate() D/About(670): onStart() D/About(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.About: 1031 ms D/UserLaunch:(670): onStop() I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.HOME} flags=0x10200000 comp= {com.android.launcher/com.android.launcher.Launcher} } D/About(670): onPause() D/About(670): onStop() D/dalvikvm(670): GC freed 413 objects / 34128 bytes in 72ms I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} flags=0x10200000 comp= {com.cequint.cityid/com.cequint.cityid.UserLaunch} } D/About(670): onDestroy() D/UserLaunch:(670): onRestart() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() Here is the relevant section of the Manifest: <application android:icon="@drawable/icon" android:label="@string/ app_name"> <activity android:name=".UserLaunch" android:label="@string/app_name" android:launchMode="singleTask" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".About" android:launchMode="standard"> </activity> </application> Anyone have any ideas why this is always resetting the Activity Stack?

View 11 Replies View Related

Android :: Droid Instrumentaion : Go Back To A Previously Launched Activity?

Feb 19, 2010

Is there anyway to go back to a previously launched Activity while running an Instrumentation test? Currently, when I use sendKeyDownUpSync( KeyEvent.KEYCODE_BACK);, this forces my test to exit, rather than go back to the previous Activity.

View 2 Replies View Related

Recovery State Of First Activity Launched?

Jan 15, 2010

I have an application that launch a thread when a ToggleButton is pressed, but if I press the home button, a new activity is started (I can return to the first activity if I press the back button), but I want to recovery the first activity launched state, which have the reference of the initial thread.

This is my code:

org.test.test.java:

////////////////////////////////////////
package org.test;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.ToggleButton;

[code]....

View 5 Replies View Related

General :: App That Run Shortcut (activity) When Launched

Jul 21, 2012

Various parts of the Android system or Android apps are designed to launch a program, but aren't capable of launching an application shortcut. For example, they're willing to run a timer application, but they aren't willing to run its "start timer now" shortcut. One example is the samsung ICS lock screen, which is neat in other respects but suffers from this really lame limitation.

Is there an app that can be configured to run another app's shortcut? For example, I could configure the lock screen to launch "Fast Shortcut Helper", and fast shortcut helper will have already been configured to run the "start timer now" shortcut.

View 2 Replies View Related

Android : Multiple Activity Instances Launched By Same Intent. Bring One Uniquely To Foreground?

Nov 12, 2010

I'm struggling with my app that launches multiple instances of the same Activity using the same intent. My main activity is of class type A and it does a startActivity() of two children that are of the same class type B. So we have B1 and B2 launched. If B1 and B2 are both paused (by pushing back button and making sure finish() is not invoked on them so they are truly paused), how can A uniquely bring either B1 or B2 to the foreground again? I do want to launch a new B activity. I want to uniquely bring B1 or B2 to the foreground.

so both B1 and B2 were created like this... Intent intent = new Intent(context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);

Now I want A to bring B1 (or B2) to the foreground/front so I use the below code, but how do I distinguish B1 or B2 when starting the activity? This only brings the last instance of B that was on top to the foreground.

Intent intent = new Intent(context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent);

I've tried keeping around references to B1 and B2 and doing something like this, but this also only goes to the last instance of activity class B that was on top...

Intent intent = new Intent(B1context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); B1context.startActivity(intent);

I even tried this, but it still doesnt get me my unique B1 or B2... Intent intent = B1.getIntent(); // i.e. the original intent that started me startActivity(intent); // still only brings to front the last B that was on top.

View 3 Replies View Related

Android :: Get Notification When A Application Is About To Be Launched

Mar 16, 2009

I need to execute some operation when the specific application is launched, it is possible to get notification when an application is to be launched, or after it is launched?

View 11 Replies View Related

Android :: MapView - Application Crash On Launched

Jun 4, 2010

I'm trying to display a map using that rotates according to the phone's orientation. I have rewrite a part of the google sample to use a SensorEventListner instead of a SensorListener.

My Problem is when I try to use the findViewByID() method to display the map my application crashes on start. If I use MapView(Context, String) to create my view it works fine. Did I miss something to use main.xml layout file ? What's wrong with this ?

Here is my code :.......................

View 3 Replies View Related

Android :: Launched Application - The Operation Timed Out

Nov 2, 2010

I am reading one simple web page, but when I launched my application after 2-3 min it show me output as: The operation timed out. Here ia my code...........

View 10 Replies View Related

Android :: Application Forces Close When Launched From The Market

Jul 2, 2009

I have uploaded application to market and met weird problem which I never received before - when I click "Open" button when the application is installed I receive error dialog and the application is forced to close. I do not have this problem when start application from desktop launcher panel. I have already receive 2 stars for that though the exception even comes not from my cod - very unpleasant surprize from market app.

Application uses vibration and declares corresponding uses-permission "android.permission.VIBRATE" - this is what the exception tells me about, but I can't see such problem with other apps that use vibration on market.

Here the exception:

CODE:..............

Here is application manifest:

CODE:.........................

View 2 Replies View Related

Android :: Registering Broadcast Receiver To Run When Application Launched?

Aug 13, 2010

I want to run some code when an app is launched, so my broadcast receiver has to be notified when user open any app.

View 1 Replies View Related

Android :: Android Application Be Launched From Built-in Phone Call Log Application

Feb 21, 2010

I would like to know if it is possible to launch my application whenever a new entry is written to phone call log (i.e. out-going, in-coming or missed call). I wrote an application to manage the call log entries as per user preferences by listening to the publication of android.intent.action.PHONE_STATE events. My application is working fine as long as its process is running. However if the user has stopped my application with a task-killer application, then the log entries can not be managed as my app itself was not running. I need a way to make sure that my application is launched in the background if it is not already running when the android.intent.action.PHONE_STATE occurs. Or is it possible to launch my application as a service that always runs?

View 2 Replies View Related

Android :: How To Determine If Activity Is On Screen?

Mar 4, 2010

I am planning to have a Service send a broadcast which a BroadcastReceiver will act on and I would like it to create a Notification if an application is not currently on screen, but if the application is on screen (ie. showing to the user) then I would like to offer a Dialog and not create the Notification.Is it possible to determine if an Activity or application is currently on screen?

View 5 Replies View Related

Android :: Determine What's Active Package Or Activity Running?

Aug 16, 2009

I want my background service to determine the active package or activity running.Is this possible?

View 4 Replies View Related

Android :: How To Determine View Size Right After Activity Has Been Started?

Feb 19, 2010

I want to do some data processing (in a thread) right after my main Activity starts. For that data processing to be started I also need to know a visible size of my main View (which is a LinearLayout currently, but whatever).I wonder how to do that. I.e. I wonder what is the entry point (callback?) I should use to be sure that my main View has been layed out, so i can use view.getWidth/getHeight? Is creating a custom View and reimplementing it's onSizeChanged() - the only way? In this case how should I properly describe it in my xml layout file? (it will contain some child views)

View 1 Replies View Related

Motorola Droid :: Gmail Password Authentication Each Time Application Is Launched?

Nov 8, 2009

I am using the standard gmail app that comes with the motorola droid. However password authentication is only required the first time the application is launched. This means anyone who picks up your phone can see your email with one touch. Is there a way to require password authentication each time the application is launched?

View 5 Replies View Related

Android :: Determine When Application Is Running

Jan 5, 2010

I have an application that uses a Service to fetch data in the background both while the application is running and when it's not. When it is not running i would like to show a notification when there is new data, but not when the app is running. How do i determine in my service whether the app is running or not?

View 6 Replies View Related

Android :: Determine Through App Incorrect Version Of Application?

Jun 7, 2010

I wanna know if there is anyway to determine not through the packages, but through applications the version of an application which isn't the current application.

let's say right now i am in the scope of app A. and i wanna run an activity from app B. i wanna check before the version code of app B.

View 1 Replies View Related

Android :: Android Database Recreates Everytime Application Is Launched

Jul 29, 2010

Why is SQLiteOpenHelper calling onCreate() every time my application starts up.

Here's my code for onCreate()

CODE:.......................

I have an outside class around my extended SQLiteOpenHelper class, and when I query, I do this:

Cursor cursor = openHelper.getWritableDatabase().rawQuery("select * from circles", null);

and skips this block because of this if statement

if (cursor.moveToFirst()) {...}


Here's my entire Database wrapper class:

CODE:.............

View 3 Replies View Related

Android :: How Can We Determine Battery Usage Statistics Per Application?

Nov 4, 2010

I am having trouble finding class or API in android documentation which can help me get battery usage statistics per application. I have read PowerManager class and BatteryManager but they are of no use .Though I can find applications like PowerTutor that do give you battery usage statistics per application, so I think its technically possible?

View 1 Replies View Related

Android :: Programmatically Determine If Application Is MarketPlace Version

Oct 7, 2010

I have an application that's offered in and outside of the MarketPlace.Is there a way of determining from within the code where the application came from? I've got a few indirect methods

1) I could simply infer from whether they have "Allow installation of non-Market applications" ticked.

2) Or I could just make separate builds and make it explicit in the code.

View 3 Replies View Related

Android :: Moving Back To A Specific Activity Always

Feb 4, 2009

I've got four activities

A, B, C and D where A is the main entry screen.

No matter how I navigate to B, C or D (via A->B or A->C-B etc), I want the back button to always go to activity A. What flag can I set to do this specifically?

View 2 Replies View Related

Android :: Run Specific Activity In Droid Emulator?

Feb 1, 2010

I have created 4 activities in eclipse now i want to run activity 1, 2,3 ,4 respectively one by one in emulator for testing.

can any one guide me how can i run those all?

when i press run button it only runs first activity.

View 3 Replies View Related

Android :: Determine When Application Icon Is Clicked To Launch App / Do I Get Call-back For This?

May 7, 2010

Is there any way to determine when the user clicked the app icon to launch the app ? I mean say a user was using my app. Then he presses the home key as a result of which the app goes to the background. After sometime he clicks the app icon again. My question is do I get a call-back for this?

View 3 Replies View Related

Android :: Moving To Specific Activity After Pressing Keypad?

Jul 29, 2010

I want to specify in code to move to specific activity after pressing back button on android keypad how I can accomplish this. Now I ot the solution to my prob onBackPressed() works after 1.6 version for previous versions we need use:
public boolean onKeyDown(int keyCode, KeyEvent event) method
My code for this solved prob is

@Override public boolean onKeyDown(int keyCode, KeyEvent event) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.CUR_DEVELOPMENT && keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
// Take care of calling this method on earlier versions of
// the platform where it doesn't exist. onBackPressed(); }
return super.onKeyDown(keyCode, event);
} //@Override public void onBackPressed() {
// This will be called either automatically for you on 2.0
// or later, or by the code above on earlier versions of the
// platform.
Intent i=new Intent(AgesWebViewIndex.this,TabCls.class);
i.putExtra("age", "agepage");
startActivity(i);
return;
}

View 2 Replies View Related

Android :: How To Trigger Intent To Execute Specific Method From One Activity?

Jun 13, 2010

I've been searching a way to implement an intent so when a user clicks on a notification, an specific method from an activity is executed (or an specific behavior happens). Right now I'm thinking about using broadcast but I don't know if this is the best way to implement this functionality. How would you implement it?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved