Android :: How Can Target Activity Get The Request Code In StartActiivtyForResult()?
Feb 11, 2010
I am starting an activity with startActivityForResult(intent,requestcode). And i am receiving result onActivityResult() call back .
The target acivity which gets the intent should get the request code And based upon the request it has to do the specified operation.
How can target activity get the request code, which is passed to startActivityForResult().
View 2 Replies
May 15, 2010
I'm experiencing the same as http://groups.google.com/group/android-developers/msg/9d37d64aad0ee357
This is Android 1.5 SDK. I happen to call several times below code(which is in a method) with the same url and it fails intermitently. When it fails, there is no exception, the stream is empty so the readConnection fails, and getResponseCode returns -1. Global caching is disabled, setDefaultUseCaches(false);
How can I workaround this?
CODE:.........................
View 4 Replies
View Related
Nov 21, 2009
I'd like to use FLAG_ACTIVITY_CLEAR_TOP to launch an activity in my app. It has one feature I don't want though - it restarts the target intent, instead of just resuming it. Example history stack, with activity D making the call to B with that flag:
A B C D
new stack
A B
But 'B' gets relaunched, its onCreate() method is called. Since B is already in the history stack, is there a way I can use this flag, but have it *not* recreate B, just onResume() it again? The reordering flags are kind of what I need too, but they won't pop C and D, just reshuffle the stack so B comes to the top, but I want C and D to go away.
View 5 Replies
View Related
Feb 15, 2010
I'm having this error every time i try to log in into any site:
Page is not available error code 400 bad request
The browser opens up pages flawlessly except for the log in part. I purged the cache, cookies and everything but still no luck.
It's on 3G connection. Haven't tested it on a wifi yet.
It seems that the HTTPS sites are causing the problem. Can't log in into Facebook through the browser, neither into www.google.com.
View 3 Replies
View Related
Mar 25, 2010
I have created an activity which sends a number of notifications to status bar. Each notification contains an intent with a bundle.
Here is the code:
CODE:..............
When user clicks this notifications, I read the bundle string "action" and performs that action. Here is the code:
CODE:.................
Everything works as expected. But, when I minimize the app using "arrow" button on device and then press and hold home button and clicks on my app icon the application starts and performs the same last action which have been performed by clicking the last notification. I figured out that when we click the app icon the application starts with last intent triggered by the notification.
View 2 Replies
View Related
Feb 23, 2010
I installed newst Android, JDK, Jer and eclipse. Than I tryed to build android project. But "build target" show "no target available". I looked at internet, they said I should run "Android SDK and AVD manager", I runed it but get follow message: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: No route to host: connect
I read this group's conversation that suggest to use http not https, I tried it but still can not run Available Packages.
View 2 Replies
View Related
Sep 18, 2010
I'm having an issue with a config activity for a widget. According to the dev docs, if I specify a configuration activity than the onUpdate method of the AppWidgetProvider doesn't get called until after you request an update once you've completed the configuration activity. For me its happening in reverse, the onUpdate method of the AppWidgetProvider gets called first, followed by the configuration activity. Then the onUpdate method is never called after completion of the config activity even though I request it explicitly. I tried with level 4 and level 7 API, same result. Here is some of the source:
Manifest:
<?xml version="1.0" encoding="utf-8"?> <manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chris.android.swidget"
android:versionCode="1" android:versionName="1.0">
<application android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:name=".SWidgetConfigure">
<intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter> </activity>
<receiver android:name=".SWidgetProvider" android:label="@string/ widget_name">
<meta-data android:name="android.appwidget.provider" android:resource="@xml/swidget_info"/> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </receiver>
<service android:name=".service.PUpdateService" />
</application> <uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
swidget_info.xml: <?xml version="1.0" encoding="utf-8"?> <appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp" android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/swidget_layout"
android:configure="com.chris.android.swidget.SWidgetConfigure" >
</appwidget-provider>
I can include source of the onUpdate method from the AppWidgetProvider activity and the onCreate method of the configuration activity if necessary, but they are both being called find its just the order they show up on the emulator is wrong.
View 5 Replies
View Related
Oct 7, 2009
What are the differences between building for target 2 (no gmaps add on) and target 3 (with gmaps addon).
Could any one has the ant scripts to bulids for these targets.
I see 1.5 SDK does these though custom ant tasks rather than 1.1 ant scripts (this was more clear and apperant on how it does the build)
View 4 Replies
View Related
Oct 4, 2010
Is there a way to notify an activity/service of a force-close request right before it gets killed?
I mean when the user hits the force close button in Menu>Settings>Applications>Manage applications>app name>Force Close.
View 2 Replies
View Related
Jul 8, 2010
this Android code worked fine before, but i'm having problems for some reason. here is the request i'm trying to make: https://www.google.com/reader/api/0/token. i'm getting 400:Bad Request as a response, and i'm not sure why. isn't this the correct URL for requesting a token? the auth token is being passed as a header in all requests now, and i can request feed list, and it works just fine, so there's nothing wrong with the auth code. what gives? in addition, i can request a token in a normal browser, like Chrome, and get a token as a response body. so the request itself is not the problem. i just can't figure out what is wrong with my requests in code...
View 1 Replies
View Related
Aug 17, 2012
I am developing an Android app for a website. I'm trying to get some information from the website by sending a cookie using a HttpGet request. I don't know where I am going wrong with the request. I am using AsyncTask to send the request to the server. The request also uses a token which I receive when I login to the webpage. All this is clear in the code below. This is part of the process in the doInBackground() function of the Asynctask:
BufferedReader in = null;
JSONObject token = Login.getToken(); // Token received after login, used in the cookie
try {
r = token.get("session_token").toString();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
[code]...
View 1 Replies
View Related
Aug 21, 2013
I own a Xiaomi MI2S, running MIUI-3.8.16 @ Android version 4.1.1.JRO03L with Baseband version CEFWMAZM-2.0.128 017.
From my phone provider (Tele2) i have to dial a 1 (one) before my PIN-code when traveling abroad.
The code is accepted, I can be called and i can send and receive SMS messages.
However i cannot make phone-calls...
The error (?) is "DIAL request modified to SS request" and (very short) "not connected"
View 2 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
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
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
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
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
Sep 22, 2010
I've a lot of initialization code in my main activity's onCreate(). When I launch my game, the screen goes black for a long time, then my game appears. I did logged some message at the start and end of onCreate() and found that onCreate() is executing its code while the screen is black. Sometimes the screen goes black for too long and phone shows a popup dialog prompting me to choose between Force close/Wait. Then when onCreate() is completed, my game appears. Choosing 'Wait' then dismiss the dialog.
I tried using progress dialog described in this article:
http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog
But it doesn't work. The screen goes black for the same amount of time even after I use the progress dialog.
View 4 Replies
View Related
Jul 25, 2010
I have a activity B that is called by activity A, I want to debug the code in B. I have set the breakpoint, however the debug control never enters B.
CODE:................
When I debug in eclipse, although the class B is called from class A, the debbugger pointer never enters the new window, where I have placed a debug point in Class B. I am not able to take the pointer control to class B and stop at a specific point, which will help me verify certain variable values.
View 2 Replies
View Related
Aug 31, 2010
Just like the title says, Is there a simple line of code I could add to onStop()that will simply stop any gps activity currently going on with my application?
View 1 Replies
View Related
Aug 5, 2009
I need to exclude an activity from appearing in recent launched menu, but i am not able of adding android:excludeFromRecents="true" in AndroidManifest.xml, I have to do it in runtime. Does anyone knows if there is possible to set FLAG_EXCLUDE_FROM_RECENTS to the activity?
View 2 Replies
View Related
Aug 5, 2009
I need to exclude an activity from appearing in recent launched menu, but i am not able of adding android:excludeFromRecents="true" in AndroidManifest.xml, I have to do it in runtime. Does anyone knows if there is possible to set FLAG_EXCLUDE_FROM_RECENTS to the activity?
View 1 Replies
View Related
Oct 1, 2009
Where is the code for Home Screen activity located?
There is a Home application in development/samples/Home --> I am not sure if it is the Home Screen code.
View 2 Replies
View Related
Jul 9, 2010
I'm trying to create a simple text based game in which I ask a question based on a movie. The list of movie's is in a text file which I've included in res/raw. So basically I want to have a default string, say "Who acted in", followed by the name of the movie. Could I have the first string (along with a submit button etc) in my res/layout/main.xml file, and follow that with the movies name, after I've extracted it from the text file in my activity, or does the layout have to be defined in one place only?
View 1 Replies
View Related
Jan 7, 2010
I'm trying to have my home-screen application register itself as the default home-screen so the user is not prompted with the IntentResolver's list of all the available home-activities.
This is my code:
CODE:.................
I have the android.permission.SET_PREFERRED_APPLICATIONS set in the manifest. After executing the code above, the logs claim things have been added like expected (same logs as when I tick off "Make default" from IntentResolver's list). However, when I proceed by clicking home, the list still shows up and the logs say:
CODE:.....................
So it seems the resolver deletes the default entry. Am I doing something wrong, or is this a security measure? What are the ideas behind this?
View 2 Replies
View Related
Aug 3, 2010
Launch of My Activity at startup with out using Action_boot_complete. Instead of displaying home screen for the first time I want to display my activity for device setup when device_provisioned == 0. How can I override the code that launches the home screen activity.
View 1 Replies
View Related
Mar 1, 2010
I had a bunch of code in an activity that displays a running graph of some external data. As the activity code was getting kind of cluttered, I decided to extract this code and create a GraphView class:
public class GraphView extends LinearLayout {
public GraphView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.graph_view, this, true);
}
public void start() {
// Perform initialization (bindings, timers, etc) here
}
public void stop() {
// Unbind, destroy timers, } }
Moving stuff into this new LinearLayout-derived class was simple. But there was some lifecycle management code associated with creating and destroying timers and event listeners used by this graph (I didn't want this thing polling in the background if the activity was paused, for example). Coming from a MS Windows background, I kind of expected to find overridable onCreate() and onDestroy() methods or something similar, but I haven't found anything of the sort in LinearLayout (or any of its inherited members). Having to leave all of this initialization code in the Activity, and then having to pass it into the view seemed like it defeated the original purpose of encapsulating all of this code into a reusable view. I ended up adding two additional public methods to my view: start() and stop(). I make these calls from the activity's onResume() and onPause() methods respectively. This seems to work, but it feels like I'm using duct tape here. Does anyone know how this is typically done?
View 4 Replies
View Related
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
Oct 30, 2009
Trying to set up my eclipse envirnment to actually be able to try some things out on android...
I've installed the sdk, put it in my path variable, installed the ADT, downloaded the "developer tools" from the eclpise menu..
But... Then I go to the command line, navigate to the tools folder of my sdk, and run "android create avd --target 2 --name mine"
and I get this "error":
Error: Target id is not valid. Use 'android.bat list targets' to get the target ids.
So, I of course happily run the 'android.bat list targets' and get the following message!
"Available Android Targets:"
That's it. There are no targets.... I open the AVD window in eclipse, there are no targets... I click "New" in that window, and a target is required, but the drop down is disabled because there are NO AVD TARGETS.
View 8 Replies
View Related
Jan 21, 2010
I'm really new at this. I'm following the book "Android" by O'Reilly press a little outdated, I'm using Pulsar for Mobile Java Developers. Build id: 20090920-1017 I go to File, New Project, Android, Android Project. I enter "Hello World" for Project Name. Then I get "An SDK Target must be specified." There is a check box but it says "no target specified". How do I get this resolved and how do I get to the command line?
View 4 Replies
View Related