Android :: Possible To Start Activity When Received Broadcast?

Dec 8, 2009

I found that the "onReceive" of broadcast intent can't start an activity explicitly. Is there any way to start an activity when I receive a broadcast? eg: I need an interaction UI with user when specific package has been installed in the system.

Android :: possible to start activity when received broadcast?


Android :: Start Another Activity With Broadcast Intent

Nov 29, 2009

I'm trying to start an activity out of a widget so I can't use the startActivity() function. So I'm trying to create the correct intent but I don't find what I'm missing.

View 2 Replies View Related

Android :: Way To Broadcast Any Intent As New Email Received?

Jul 28, 2010

Do any one know how to broadcast any intent if new email is received?

View 8 Replies View Related

Android :: Send Data Packets Out After Broadcast Event Received

May 27, 2010

I know that the apps receive a ACTION_SHUTDOWN broadcast event when the device is shutting down.
When an application receives the shutdown, is there still an opportunity to send data packets out, or does android block such attempts(or does the platform tear down the network stack before it can go out).

View 1 Replies View Related

Android :: Start TTS From Broadcast Receiver

Jul 9, 2009

I am trying to start TTS from a broadcast receiver and it as document an intent receiver can't bind the service. Is there a work around, I can't figure out how to start the service using startService(Intent, Bundle).

View 4 Replies View Related

Android :: How To Start SmsSenderactivty In Broadcast Receiver?

Aug 18, 2010

I am recieving SMS ,through Broadcast reciever and poping a toast about sms, thean in other class i had smsSenderActivity ? i have to call that Activity when i click Ok on toast that poped , when sms comes ? How do i call smssender Activity ?

View 1 Replies View Related

Android :: Start And Stop BOOT_COMPLETED In Broadcast Receiver

Jun 22, 2009

Could we, and how start and stop a broadcast receiver receving the android. intent. action. BOOT_COMPLETED?As I want have control on a service awaken by the BOOT_COMPLETED.

View 2 Replies View Related

Android :: Google Maps Broadcast Event For Audible Navigation Instructions / Start And Stop?

Dec 14, 2009

I have an application which is playing audio.I have some customers that use this application while driving and who also use the Google Maps application to get directions to the places where they are driving.They have asked me to change my application to pause my audio while the Google Maps application is giving them audio navigation instructions. I am trying to find out if I can register a Broadcast Receiver to let me know when the Google Maps application is giving audio navigation instructions, or if there is a way to detect when any other application has started or stopped playing audio.It seems that this type of functionality would be beneficial for Google Maps and for any type of application which is playing media, so I am hoping that Google Maps is broadcasting events when it starts and stops giving audio navigation instructions, or that there is a generic way to discover when overlapping audio sources are trying to play.

View 6 Replies View Related

Android :: Broadcast Receiver Without Activity

Feb 12, 2010

A WAP PUSH (Broadcast)receiver basically doesn't need any UI. It is a silence application which handles the Push messages based on actions/ mimetype without needing any intreaction with user, I've tried to test it in a SMS receiver by removing the Activity from the project and it stopped receiving the SMS messages. My question: Does all android applications "MUST" define a activity? Is there a way to hide it?

View 5 Replies View Related

Android :: Start An Activity And Return Back To Original Activity

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

Android :: Start Activity When Main Activity Is Running In Background

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

Android :: Starting An Activity From Broadcast Receiver

May 28, 2010

I am trying to launch the Main Activity from a broadcast receiver. Can anyone guide me as to how I can do it? I always get "Process is Bad" message.

View 1 Replies View Related

Android :: How To Call Broadcast Receiver From Activity?

Jul 9, 2010

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)

View 3 Replies View Related

Android :: Recieve Broadcast Action In An Activity?

Feb 14, 2010

Can I receive a broadcast event in an activity? I've seen this done in broadcast receivers but not in an activity. In particular I would like to receive an event when a bluetooth device is found. ACTION_DISCOVERY_FINISHED.

Do I need to declare that in the activity intent filters? Should I be using permissions for that? How do I define the callback to handle that in the activity when i get receive the action?

View 2 Replies View Related

Android :: Start An Activity In Different Apk Using StartActivity - Using The Activity Name Or Similar

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

Android :: Activity Check Service To Start Another Activity

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

Android :: Start Activity And Clear Activity History

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

Android :: Starting Translucent Activity From Broadcast Receiver

Sep 30, 2010

I got a graphical problem regarding the Translucent theme at Samsung Galaxy i9000.It works well in the emulator with android version ranging from 1.6 to 2.2 as well as on SE x10 mini.I have yet to test on more devices.I am starting an activity from a broadcast receiver. The activity started got the theme @android:style/Theme.Translucent If all the activities in my application are destroyed when the broadcast occurs, then the new activity got a working translucent theme and is presented on top of the activity currently in front. However, if the user left the application with the HOME-key, not destroying the activity, I get a graphical bug when the broadcast triggers. The application gets brought to the front with the activity the user last visited showing instead of the new activity that I started from my broadcast receiver. When I press the back key I can see my Translucent activity quickly showing itself and then getting destroyed.This flow results in the graphical bug: Start application. Activity A will be shown. Leave application by pressing HOME-key. Home screen is shown. Trigger broadcast. Start activity B.

Application gets brought to foreground and activity A is shown. Press BACK-key. Activity B quickly shows itself and disappears. Now activity A is shown.Also, after activity B is started and when activity A is shown in its place. Pressing the screen will triggers buttons that belong in activity B even if the user can't see them. If I remove the theme, then activity B will show itself when it's supposed to.Is there anyone else who have encountered a similar problem? Is there any good workarounds I can apply? (I don't want to rebind home to finish all activities) Is the problem my fault or can there possibly be some glitch in Touchwiz?

View 2 Replies View Related

Android :: Broadcast Receiver / Service Will Only Restart Activity Once

Mar 17, 2010

I have a single Activity application, within it I have a service which creates an AlarmManager and sends a broadcast to a broadcast Receiver.If the activity which starts the services dies, (ie. divide by zero), the broadcast receiver stops the old service which created the AlarmManager.It works the first time. The second time, it does not.It seems like the AlarmManager is still active but the broadcast receiver is no longer receiving. It works great once!

View 2 Replies View Related

Android :: Update Activity / Layout From Within Broadcast Receiver

Jun 29, 2010

I have a layout with two buttons, I want to disable or make unclikable one of the buttons when internet connection is lost and back to clickable when connection is regained. From my broadcast receiver I am calling another class(which extends activity and thus can call findViewById) which is attempting to change the main layout. App is force closing. What am I doing wrong here, any other ideas as to how to achieve what I am trying to do.

View 4 Replies View Related

Android :: Notify Running Activity From Broadcast Receiver?

Jun 26, 2010

I have an activity, it needs to response to a broadcast event.Since an activity can not be a broadcast receiver at the same time,I made a broadcast receiver.My question is: how can I notify the activity from the broadcast receiver?I believe this is a common situation, so is there a design pattern for this?

View 1 Replies View Related

Android :: How To Send Data From Broadcast Receiver To Activity?

Mar 25, 2010

I am writing an application to listen the SMS inbox in android with one activity and one BroadcastReceiver. Once the SMS comes the Receiver is showing alert message. But I want to send the message information from Receiver to Activity. I don't know how to achieve this.

View 2 Replies View Related

Android :: Broadcast Message Leave Activity In Background

Oct 31, 2010

My app's main activity listens to a broadcast message. When it receives the message it brings the activity to the front. I want to update the activity if it is in the front, so the user is playing with it, but otherwise I do not want to bring the activity to the front. How should I do it? Is there a flag for invoking the intent, or what?

View 4 Replies View Related

Android :: Start A New Activity From Anther Activity

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

Android :: Start An Activity From Non Activity Class

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

Android :: Broadcast Receiver Can't Receive UMS_CONNECTED - UMS_DISCONNECTED Msg Dynamically In Activity?

Nov 20, 2009

I was make source to catch and process SD Card mount/unmount broadcast received dynamically in activity.

but the USM_CONNECTED/DISCONNECTED broadcast msg is not catched dynamically in activity like below:.

how the receiver can receive the UMS msg in activity?

below:

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

View 3 Replies View Related

Android :: Start A Map Activity From Other Activity

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

Android : Default SMS Activity Result Code Coming As RESULT_CANCELED Even SMS Is Received Successfully

Jul 20, 2010

I am invoking the default SMS activity by using the following code-

intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:")); intent.putExtra("sms_body", "SMSText"); startActivityForResult(intent, 11); //Here 11 is my request code

The SMS activity gets opened in emulator (5554), i type the number 5556 (device number of my second emulator) and click on "Send"

The SMS is received in second emulator(5556) successfully. I click back on 5554 (my SMS generating emulator )and come back to my application. I notice that the onActivityResult method is getting called successfully as desired.

When i check for the result code i get it as RESULT_CANCELED ( 0 ) instead of RESULT_OK (-1). The data is also coming as null.

View 3 Replies View Related

Android :: Android - SMS Broadcast Receiver / No Launcher Activity Found

Nov 7, 2010

I have been trying to get this program to work but so far having no luck. I cannot find where I am doing wrong. I'm not sure if there's something wrong with the code, or debugging.

Here is my program:
package Technicaljar.SMSBroadcastReceiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;

public class SMSBroadcastReceiver extends BroadcastReceiver {
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
private static final String TAG = "SMSBroadcastReceiver";
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "Intent received: " + intent.getAction());
if (intent.getAction() == SMS_RECEIVED) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
Object[] pdus = (Object[])bundle.get("pdus");
final SmsMessage[] messages = new SmsMessage[pdus.length];
for (int i = 0; i < pdus.length; i++) {
messages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
} if (messages.length > -1) {
Log.i(TAG, "Message recieved: " + messages[0].getMessageBody());
} } } } }

And the manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Technicaljar.SMSBroadcastReceiver"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" >
<receiver android:name=".SMSBroadcastReceiver">
<intent-filter>
<action android:name="android.provider.telephony.SMS_RECEIVED"></action>
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS">
</uses-permission>
</manifest>

I am sending SMS through Telnet, and I cannot see any Intent received messages in the logcat. Here is my logcat from the time of installation.

D/AndroidRuntime( 478):
D/AndroidRuntime( 478): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 478): CheckJNI is ON
D/AndroidRuntime( 478): --- registering native functions ---
D/AndroidRuntime( 478): Shutting down VM
D/dalvikvm( 478): Debugger has detached; object registry had 1 entries
I/AndroidRuntime( 478): NOTE: attach of thread 'Binder Thread #3' failed
D/Mms:app ( 220): getSmsNewMessageNotificationInfo: count=14, first addr=12345, thread_id=4
D/dalvikvm( 151): GC_EXPLICIT freed 391 objects / 22552 bytes in 65ms
D/dalvikvm( 220): GC_EXPLICIT freed 926 objects / 44840 bytes in 73ms

So the SMS seems to be received by the emulator, but looks like the no intents are firing.
What am I doing wrong here? After installing, do I have to somehow 'start' this receiver?
Because when I install, I get

[2010-11-07 21:24:41 - SMSBroadcastReceiver] No Launcher activity found!
[2010-11-07 21:24:41 - SMSBroadcastReceiver] The launch will only sync the application package on the device!

View 1 Replies View Related

Android :: Is This Systems Broadcast Ordered Or Normal Broadcast?

Aug 13, 2010

I'm trying to figure out if a system event broadcast is broadcasted using ordered broadcast or normal.The event is EVENT_REMINDER and in the source for the calendarprovider i noticed it sets up a alarmmanager to sent the broadcast. I can't find how the alarmmanager sends it. My guess would be as a normal broadcast , But while i was trying some things i noticed i could delay the system's notification (tried up to 10 sec) by building a sleep in my broadcastreceiver. This would indicate that they are handled ordered , and the systems receiver is only called when mine has finished. But can i be sure of this behavour?? (in all 1.5> sdk versions) the docs state that in some cases normal broadcasts are also handled ordered..due to spare of resources.

View 1 Replies View Related







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