Android :: StartActivityForResult Function ?

Sep 23, 2009

I have a problem with the startActivityForResult function?

My code:

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

But the second intent is only starting and if i finish the second intent (getPicture), the first intent is called. Why?

The logcat shows:

CODE:.......

So why the savefilename-activity doesn't start first?

Android :: startActivityForResult function ?


Android : Use StartActivityForResult From Non-activity?

May 17, 2010

I have MainActivity which is an Activity and other class(which is a simple java class), we`ll call it "SimpleClass".
now i want to run from that class the command startActivityForResult.

now i though that i could pass that class(SimpleClass), only MainActivity's context, problem is that, u Cant run context.startActivityForResult(...);

so the only way making SimpleClass to use 'startActivityForResult; is to pass the reference of MainActivity as an Activity variable to the SimpleClass
something like that:

inside the MainActivity class i create the instance of SimpleClass this way:

SimpleClass simpleClass=new SimpleClass(MainActivity.this);

now this is how SimpleClass looks like: code...

now its working, but isnt a proper way of doing this? I`am afraid i could have some memory leaks in the future.

View 2 Replies View Related

Android : Tap Activity After StartActivityForResult?

Nov 23, 2009

I have two buttons in an activity/view A0, b1 and b2 that respectively starts (for result) the activities A1 and A2. After tapping/clicking b1 I quickly tap b2 aswell. The result will be that both A1 and A2 are launched. Is there any obvious way to not have this behaviour, i.e. to "lock" A0? I am thinking of overriding dispatchTouchEvent to consume everything after the call to startActivityForResult, but it seems a bit much...

View 2 Replies View Related

Android : Way To Use StartActivityforResult() For Email Intent

Sep 23, 2010

I am using intent for send email with attachment,it is work fine,i want to get this email intent result,i already used startActivityforResult(),but i can't get result for email intent,how can we use startActivityforResult() for Email intent?

View 1 Replies View Related

Android :: Sending / Receiving Data Using StartActivityForResult

Apr 21, 2009

Ok, I have 2 Activities I want to send data between activity A and B.My problem is that some random code of mine seems to be called between startActivityForResult() and onActivityResult()in Activity A.This doesn't make any sense because there is no code after startActivityForResult() is called.Shouldn't onActivityResult() be the first thing A does after B finishes?

View 2 Replies View Related

Android : Handeling StartActivityForResult On Back Button

Jul 14, 2009

I am working on an app and I use startActivityForResult but currently if you press the back button on the new activity it will crash my app. In my new activity I have

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

But that didn't fix the problem.

View 7 Replies View Related

Android : How Activity.finish() / StartActivityForResult() Collaborate With Each Other

Nov 12, 2010

I got a question about Activity.finish(). In my Android code, there are 4 activities(A,B,C,D). The starting activity A calls startActivityForResult(intent, reqCode) to start activity B. B starts C, and then finish(), not waiting for result. C does exactly the same as B, starts D and then finish(). D will return some result, by setResult(resultCode).

When my code runs and activity D returns some result, A will catch a RESULT_CANCELED on onActivityResult(), even if RESULT_OK is returned in D. I guess the RESULT_CANCELED is from activity B, which has been terminated before D returns a result, rather than from D.

But, my question is, why activity A catch RESULT_CANCELED after D returns some result, rather than immediately after B is terminated? And, what should I do to make A catch results from D? Do I have to keep B and C alive, to pass results from D to A?

View 2 Replies View Related

Android :: How To Pass Large Amount Of Data During StartActivityForResult

Nov 3, 2009

From one activity, I want to pass a lot of data (about 1MB of Strings).I tried sticking it in Intent.putExtra(ArrayList<String>), but if I put in too much data, I get "FAILED BINDER TRANSACTION".What's the easiest way? I don't want to publish a service, or use the file system. I really want a pipe that can write data from one end and read it from the other end. I can handle the case where the starter Activity dies while the "startee" activity is trying to read from the pipe.

View 6 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 : Lifetime Of Background Parent Activity After StartActivityForResult()?

Jul 19, 2010

Is there an exception in the lifetime rules for a parent activity that's in the background after invoking startActivityForResult()? From my understanding, in low memory scenarios, the background activities are killed before the foreground. Does this rule still apply even if the background activity started the foreground one for the purpose of obtaining some result?

In this case, I think it would make sense for the foreground child activity to get killed first or to equalize the lifetime of the parent and child.

View 5 Replies View Related

Android :: Android: Why Doesn't Activity Appear Immediately After Calling StartActivityForResult

Sep 25, 2009

The application I'm currently working on consists of several dialogs and there is an issue with one dialog I still haven't found the cause.

Running the debugger the execution reaches the following two lines:

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

And then the onCreate() method in DlgLogin class executes as well

But the login dialog doesn't appear. If I leave the device idle for such long period of time that the screen turns off and then press any button on the device to turn it on the login dialog appears.

The dialog of course should appear immediately but so far haven't found the cause of the problem.

View 1 Replies View Related

Android :: Trying To Use New Reboot Function _ Bug?

Aug 10, 2010

I'm trying to use the new reboot function defined here: http://developer.android.com/reference/android/os/PowerManager.html#r. but I'm running into permissions issues even though I have the REBOOT permission in my manifest: <uses-permission android:name="android.permission.REBOOT" /> The error I see in logcat is: E/Android Runtime( 5272): java.lang.SecurityException: Neither user 10059 nor current process has android.permission.REBOOT. The REBOOT permission doesn't show up in the list of permissions for my app even though other permissions do. Is this a functionality that is still protected even though it's now a part of the public API? All of my testing so far is on a Nexus One with Android 2.2

View 3 Replies View Related

Android :: When SIM PIN Is Blocked - Ril Can Not Function Well

Mar 11, 2009

I have met a problem with the RIL. I am using reference ril to implement SIM PIN unlock function. When i use a pin blocked SIM card, the Android Java code through exceptions and the "rild" is repeatedly disconnected and reconnected. The at command response is correct and i suppose it is right for the reference ril to report "GENERIC FAILURE" when SIM Pin is blocked. I can not figure out the reason for the error. Can somebody help me.

View 4 Replies View Related

Android :: Any Way I Can Change Function Of A Key?

Sep 12, 2010

the end / power key (button) doesnt work anymore on my mt3g, its like always pressed. Is there any way I change the function of the search key to end / lock ?

View 1 Replies View Related

Android :: Regarding Substring Function ?

Jan 28, 2009

How the substring works in android? I will be greatful if you can give a sample application for the same.

View 2 Replies View Related

Android :: Led Function On The HTC Desire Z With Handcent

Nov 11, 2010

I'm having a bit of a problem with the led function on the HTC Desire Z with Handcent. Coming from a HTC Hero, whenever I get a new message my LED and trackball would flash continually until I opened the text message. But now on the Z the trackpad and LED will flash for a while then stop. Is there a way of having it like the Hero?

View 3 Replies View Related

Android :: Call Outside Function From Thread?

Jun 10, 2010

say for example I have this code in my activity:

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Thread cThread = new Thread(new Runner());
cThread.start();
}

private NotifyMe(){
//do something here
}


and this is my Runner class:

public class TCPClient implements Runnable {
public void run(){
//call NotifyMe() [THIS IS MY QUESTION]
}
}


I have a thread on my activity that runs the Runner Class. Once the thread start, I would like to call the NotifyMe() function that is located at the activity. Is this possible?

View 2 Replies View Related

Android :: .NET Trim Function In Java?

Aug 8, 2010

In an Android app, I am looking for the functionality of the .NET string function [Trim('aaa')] which will trim off the text "aaa" off a string. I don't think this is natively available in Java and I haven't seen that functionality in Android Java textutil library. Is there an easy way to have a Java app trim a set of characters from the string?

View 2 Replies View Related

Android :: Phone Sleep Function

Sep 16, 2010

I previously had a blackberry curve and loved the sleep function where phone would shutoff every night ay 10 and turn itself on at 6:00, is there an app/function for the droid where I can do the same?

View 1 Replies View Related

Android :: Want To Use Radar Function In Package

Jun 7, 2009

How can use intents in the following: I want to use the RADAR function in the package: com.google.android.radar.SHOW_RADAR I got that I need to input the following: Code...

View 8 Replies View Related

Android :: Defining A Callback Function For A Given Value

Sep 13, 2010

In Java, is it possible to associate some object (i.e. a String) with a function to be called ? I have two similar menus and both have a onClickListener with some code like this: Code...

View 4 Replies View Related

Android :: Set Wallpaper Button Function

Aug 11, 2010

I've created a custom gallery; however, the "Set wallpaper" button will not set the wallpaper. Here's the wallpaper.java I have. I'm just lost on how to implement OnClickListener and then set my button to use an onclicklistener like so:

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

View 1 Replies View Related

Android :: GluUnProject Function Always Return NaN

Nov 20, 2009

i want to get the 3D coordinate from the android screen x,y coordinate i choose to use the gluUnProject but the gluUnProject function always returns NaN why?

View 3 Replies View Related

Android :: Print Screen App / Function?

Jan 17, 2009

Do you guys know of an application/function that will allow you to take a screenshot of your G1 screen?

View 2 Replies View Related

Android :: What Is This Nameless Synchronized Function

Aug 24, 2010

What does this line from the following code sample mean? "synchronized (_surfaceHolder) {_panel.onDraw(c);}"

I can guess what it does, but what is it called and how does it works? Is it a nameless synchronized function? Code...

View 2 Replies View Related

Android :: Function To Get Highest Value In Column

May 25, 2009

I have an URL pointing to content and I need to get highest value contained in one of the columns. Is there any aggregate function that will accomplish that or do I have to do this manually?

View 2 Replies View Related

Android :: How To Set Delay In OnClick Function

Nov 16, 2010

I'm in a process of creating a memory game. My problem is that whenever i click for the second time, i can't even see toggled button. To be clear - first click toggles the togglebutton, so i can see the number it holds, the second click on a different togglebutton is suposed to toggle it, show me the number and then proceed to either set a score +1 if numbers are the same, or reverse them back again if they're different.

Below is the code that i use as my onClick function, i've been thinking about putting some kind of sleep or delay function somwhere in the second "if block" - (if(klikniecia ==2)).

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

I think, about setting a delay here, so i can see both of the cards, regardles if the're the same or not before reverting them.

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

View 3 Replies View Related

Android :: Opengl In Droid 2D UI / What's Function?

Apr 8, 2010

In android 2D UI, what's the function of opengl?

graphic system draw picture and text by skia->opengl->framebuffer, so in 2D UI what's the function of opengl?

in bootable/recovery/minigui the recoverty mini UI just display some png and text, why does it use opengl ?

View 3 Replies View Related

Android :: How To Do An Encrypt / Decrypt Function

Jun 30, 2010

I am working on an android application, and I need to use encryption for one aspect of it. I am really indifferent to which algorithm I use (AES, DES, RSA, etc...). I am aware that Java has a crypto package, but I am not at all familiar with. Can someone post an example on how to do an encrypt/decrypt function?

View 2 Replies View Related

Android :: Link To Another Package's Function?

Sep 9, 2010

I've got two android apps, one with a public void. How would the other app call this function?

View 1 Replies View Related







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