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.

Android : Default SMS Activity Result code coming as RESULT_CANCELED even SMS is received successfully


Samsung Moment :: Odd Code For Text Coming Thru On Received Text Msgs

Dec 1, 2010

The following code is coming in instead of regular text in my received text msgs. It's randomly coming in on various lengths of text on various people.

��^��;�A�F��2n��F �Pdӑ =�4nA� } lӯ* �

I was wondering if anyone knew what this was and how I can decode it?

View 26 Replies View Related

Android :: Native Code Called Successfully But Not Executed Properly

Sep 10, 2009

In Android , Native code is written as follows.
JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) {
printf("THIS IS TEST");
}

View 7 Replies View Related

Android :: Code Schedule Task Not Giving Properly Result

May 18, 2010

I am using below code for scheduling a task in android but its not giving any results.

int delay = 5000; // delay for 5 sec.
int period = 1000; // repeat every sec.
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {

public void run() {
Toast.makeText(getApplicationContext(),"RUN!",Toast.LENGTH_SHORT).show();
}

}, delay, period);

View 2 Replies View Related

Android : Can I Get Result From A Sub Activity?

Aug 5, 2010

When user presses a button from a webview, I open a scrollview activity with some buttons and edittext fields.

Once the user enters the fields and presses the 'create' button, from scrollview activity, I want the results from the called activity to be accessible. How can I do thi?

View 1 Replies View Related

Android : Need To Get Result Back From Activity?

Mar 10, 2010

I'm doing some network job in AsyncTask. Sometimes it requires communication with user. (connection is dropped, session is expired and so on). I want to pop up a dialog or launch an Activity, and then, depending on user's input, stop the job or redo it. I can launch any Activity from AsyncTask, but how to get result back? It seems to be possible only if I launch new Activity from another Activity. What are possible solutions?

View 5 Replies View Related

Android :: Start Activity From Service - And Getting Result From It

Feb 11, 2010

I have a Service which needs to receive data from external packages. So, to locate the data providing external packages, I use activity- filter and PackageManager.queryIntentActivities function to locate the interesting packages. Now, from each such package, I need to get a ContentProvider URI. So I want to start the external Activity and the external activity will return a result to my service - something like "startActivityForResult". The problem is that there is no way to call "startActivityForResult" from a Service, only Activity can do that, and my project does not have any Activity, and probably can't show UI for the user.

The bottom line: Can anyone suggest a way to get ContentProvider URI from an external package, while my package has only a Service?

View 22 Replies View Related

Android :: Get Mail Sent Notification In Activity Result

Aug 30, 2010

I am launching a mail activity by
//Sending mail final int SENT_MAIL = 1;
startActivityForResult(Intent.createChooser(i, "Send mail"),SENT_MAIL);
and in
onActivityResult(int req, int res,Intent data)

I am trying to find the result of email sending, so as to confirm if my mail was sent or was discarded by the user. I am receiving null for Intent data.
i.e. data =null
parameter in onActivityResult(int req, int res, Intent data), res is always 0.
ie. res = 0;

View 1 Replies View Related

Android :: How Does Service Return Result To Activity

Oct 1, 2010

i seem to have a classic task, yet i can't find any examples on how to do it.i want to download something. well i call a web service and get a response but its pretty much the same.in order to do this i have an activity that starts a service that spawns a thread that does the job.now i would like to use the data i got in the activity that started the service.(i assume that starting another activity to handle the job of displaying the result would be simple)my problem is how does the service notify an activity (the one that started it or another one) of something.

View 1 Replies View Related

Android : Way To Get Result From Settings Activity Intent?

May 4, 2009

I am currently trying to launch a GPS settings activity using startActivityForResult....however it never seems to be calling my onActivityResult function after it exits. I noticed the docs mentioned that some Intent protocols are not defined to return a result, is this one such example? are there any flags that I could set to either make the settings activity call onActivityResult, or even better make my activity block until the launched activity returns?

View 5 Replies View Related

Android : Receive CameraActivities Result In A Different Activity?

Mar 12, 2010

I hope the title says it all: I've got Activity A which fires up the Camera intent via:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, REQUEST_CAMERA);

After the picture is taken I can easily grab the picture in:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)

But I'd like to receive the result in Activity B in which the image can be edited.
Right now I'm receiving the result in Activity A and pass it over to Activity B which results in showing the GUI of Activity A for a short while:

Intent i = new Intent().setAction("DisplayJPEG");
i.setClass(this, EditImageActivity.class);
i.putExtra("IMAGE_URI", uri);
startActivityForResult(i, REQUEST_EDIT_IMAGE);

Of course, I will need the result from Activity B in Activity A after the image has been edited. But that should work with:

setResult(resultCode, data);

So there has to be a way to do what I need. Please point me into the right direction.

View 3 Replies View Related

Android :: Analog Of Start Activity For Result For Service

Jul 14, 2010

Despite similar question was asked, I have differnet situation: My app consists mostly of a background Service. I want to start external activities and get results back.I see several options:Create dummy Activity and keep reference to it for using its startActivityForResult. This consumes quite a lot of memory, as we know. Use Broadcast Intents instead of Android's results infrastructure: ask client activities to broadcast their results before closing. This kind of breaks the idea and not so performance-efficient. Use Instrumentation directly - try to copy code from startActivityForResult into my Service. Use Service interfaces - serialize and add AIDL connection to the Intent for starting an Activity. In this case Activity should call Service directly instead of providing result. The third approach feels closer to Android for me, but I'm not sure if it's possible to do - Service does not have its Instrumentation, and default implementation seems to always return null.

View 1 Replies View Related

Android :: Get Result From Search Manager To Main Activity

Nov 18, 2010

Activity A is main activity. Whereas Activity B is SearcActivity (Search Manager). Activity B is List Activity, so whatever result comes, result is displayed in the list. Once user clicks on the list, I want to get that list selected item to be returned to ActivityA.What I did. Code...

View 3 Replies View Related

Android : Return A Result (startActivityForResult) From A TabHost Activity?

Mar 23, 2010

I have 3 classes in my example:
Class A, the main activity. Class A calls a startActivityForResult:

Intent intent = new Intent(this, ClassB.class);
startActivityForResult(intent, "STRING");

Class B, this class is a TabActivity:

Intent intent = new Intent(this, ClassC.class);
tabHost.addTab...

Class C, this class is a regular Activity:

Intent intent = this.getIntent();
intent.putExtra("SOMETHING", "EXTRAS");
this.setResult(RESULT_OK, intent);
finish();

onActivityResult is called in Class A, but the resultCode is RESULT_CANCELED instead of RESULT_OK and the returned intent is null. How do I return something from the Activity inside a TabHost?

I realize that the problem is that my Class C is actually running inside of Class B, and Class B is what is returning the RESULT_CANCELED back to Class A. I just don't know a work around yet.

View 4 Replies View Related

Android :: How To Pass Result From Activity Terminated By BACK Button?

Apr 20, 2010

I am trying to setResult after the BACK button was pressed. I call in onDestroy. So, how can I pass result from activity terminated by BACK button?

View 2 Replies View Related

Android : Forward Activity Result To Parent With SingleTop Launch Mode?

Jun 1, 2010

I have two activities: a MainListActivity, and a DetailViewActivity. DetailViewActivity is set with android:launchMode="singleTop".

When clicking an item in the "main list" activity, it launches the "detail view" activity via:

startActivityForResult(detailIntent, REQUEST_CODE_DETAIL);

If I then call setResult(RESULT_OK, resultData); and finish(); from within the Detail activity, that resultData is received by the "main list" activity's onActivityResult(..) method correctly.

However, if I implement a "see previous"/"see next" type of navigation within the Detail activity, and implement it using singleTop, that result no longer gets sent back to the initial activity:

Intent nextItemIntent = this.createIntent(nextId);
nextItemIntent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
startActivity(nextItemIntent);
// at this point, my DetailActivity's onNewIntent() method is called, and the new data is loaded properly

But from here, when I call setResult(..) and finish(), my MainList activity never receives the new/updated result. Anyone know what I'm doing wrong?

View 1 Replies View Related

Android : Activity Not Coming To Foreground

May 2, 2010

I'm getting the outgoing number using BroadCastReceiver and then starts a Activity. but my activity runs in the background??? how can i bring it to foreground? ...

View 5 Replies View Related

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.

View 3 Replies View Related

Android :: Default Application Source Code?

Nov 9, 2010

I have downloaded the Source code of Android 2.2. Where can I find the default application source code of Android (Calculator,Calender etc on pressing Home Button).

View 1 Replies View Related

Android :: Want Default Application Source Code

Oct 19, 2009

Is there any repositry for the default apps source code like Contacts,Launcher,etc.I do know about the android source.com. But i dont have a Linux or Mac box.Hence is there a place where i can download the default apps.

View 2 Replies View Related

Android :: Clear Defaults By Code - After Setting Use By Default For This Action

Mar 10, 2009

I'm playing with the alternative Home app that comes with the SDK.

I can set this as default for 'Home' action.

I can unset this by -->Setting->Manage Application->My Alternative Home-> "clear defaults"

Question:

How to do this "clear defaults" by code?

I've browsed the forums but cannot find an answer.

View 2 Replies View Related

Android :: Start Other Activity By Code

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

General :: Default Messaging App Source Code?

Feb 18, 2010

I was wanting to look at the default sms app to see how it works and possibly look into modifying parts. I've googled high and low and still havent found the source / how I would get it just for the sms app?

View 9 Replies View Related

Android :: Set Activity Enabled By Java Code?

Sep 25, 2009

android:enabled can be set at AndroidManifest.xml <activity android:name="MyActivity" android:enabled="true">
How can I set the attr true or false in my programm?

View 3 Replies View Related

Android :: Setting Activity Orientation By Code?

Nov 24, 2010

It is possible to set the orientation of an activity in the manifest file. but is it also possible to do it from code? if so, how?

View 2 Replies View Related

Android :: Example Code To Pass Value From New Activity To Old In Droid?

Aug 26, 2010

I am using two Activity as Old Activity and New Activity,i want to pass some value from New Activity to Old Activity.how can i pass the value from New Activity to Old Activity. please give some example code for that.

View 2 Replies View Related

Android : Stop Dialer Activity From Same Code?

Oct 11, 2009

I have started dialer activity with code

Intent myIntent = new Intent(Intent.ACTION_CALL, Uri.parse(createTelUrl("1234567"))); startActivityForResult(myIntent);

Is there a way to stop the dialer activity from same code.? Logically it should be possible as i started it and i should have rights to stop it as well.

View 5 Replies View Related

Android :: Getting Phone Number From Default SMS Activity

Jul 14, 2010

I have started the default SMS application and specified the SMS text to be sent through following code- intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:")); intent.putExtra("sms_body", "SMS Text"); startActivity(intent);It worked fine and sends the message to selected number from contact list.My requirement is that i want to know the number to which my SMS was sent?

View 6 Replies View Related

Android :: How To Declare Default Searchable Activity

Oct 28, 2010

I am trying to implement search in my application.

My application contain 4 activities and I want to add the search dialog only on 3 of them while only one of them (ProductsActivity) will be the default context.

unfortunately while I activate the search I keep getting the following error:
"Key android.app.default_searchable expected String but value was a java.lang.Integer. The default value was returned." code...

View 1 Replies View Related

HTC Desire :: Default Security Code To Bar Incoming Calls?

Jun 27, 2010

Just got a new Desire, i want to bar incoming calls and its asking me for a security code, what is it, Ive tried all the obvious defaults and they just come up with Network Or Sim error

View 2 Replies View Related







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