Search Results

Search found 3983 results on 160 pages for 'activity'.

Page 2/160 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Passing Activity A's data into Activity B

    - by user1058153
    What i am trying to show here is that I am trying to pass the data in Activity A to Activity B. Activity A mainly there are 3 textbox for me to key in something then a button to go to Activity B(Confirmation Page) and in Activity B, i am able to show what i have keyed in Activity A. I am new to Android, so can someone guide me through this? In Activity A @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activitya); Textview01 = (EditText) this.findViewById(R.id.txtView1); Textview02 = (EditText) this.findViewById(R.id.txtView2); Textview03 = (EditText) this.findViewById(R.id.txtView3); mButton = (Button) findViewById(R.id.button); mButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent i = new Intent(ActivityA.this, ActivityB.class); i.putExtra("Textview01", txtView1.getText().toString()); i.putExtra("Textview02", txtView2.getText().toString()); i.putExtra("Textview03", txtView3.getText().toString()); startActivity(i); In Activity B. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.confirmbooking); TextView txtPickup = (TextView) this.findViewById(R.id.txtPickup); TextView txtLocation = (TextView) this.findViewById(R.id.txtLocation); TextView txtDestination = (TextView) this.findViewById(R.id.txtDestination); txtLocation.setText(getIntent().getStringExtra("Location")); txtPickup.setText(getIntent().getStringExtra("Pick Up Point")); txtDestination.setText(getIntent().getStringExtra("Destination")); In my Activity B XML <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="txtView01:" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/txtView01"></TextView> <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="txtView02:"></TextView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/txtView02"></TextView> <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="txtView03:"></TextView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/txtView03"></TextView> <Button android:id="@+id/btnButton" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Book now" /> </LinearLayout> Can someone tell me if this is correct? I'm getting some error like a popup Instrumental.class. LogCat shows : 11-26 17:27:40.895: INFO/ActivityManager(52): Starting activity: Intent { cmp=ActivityA/.ActivityB (has extras) } 11-26 17:27:42.956: DEBUG/dalvikvm(252): GC_EXPLICIT freed 156 objects / 11384 bytes in 346ms 11-26 17:27:47.815: DEBUG/dalvikvm(288): GC_EXPLICIT freed 31 objects / 1496 bytes in 161ms

    Read the article

  • About lifecycle of activities

    - by janfsd
    In my application I have several activities, the main screen has 4 buttons that each start a different activity. So one of them is a search activity, once it searches it shows you a result activity. This result activity can be reached from other activities, so in general something like this: Main activity -> Search activity -> Result activity Main acitivty -> someother activity -> Result activity Now, if I have reached this result activity and press back once or twice, and after that press the Home key it will show the Home screen. But if I want to get back to my application by holding the Home button and clicking on my app it will always go back to the Result activity, no matter which activity was the last one I was using. And if I press again back it will take me back to the Home screen. If I try it again it will take me again to the Result activity. The only way to avoid this is to start the application by clicking on the app's icon. And this takes me to the last activity I was using and it remembers the state so if I press back again it doesn't take me to the Home screen, instead to the activity before it. To illustrate this: Main activity -> Search activity -> result activity --back--> Search activity --Home Button--> Home Screen --Hold Home and select the app --> Result activity --back--> Home Screen --Click application icon--> Search activity --back--> Main activity Another thing that happens is that if I press the Home button while on the Result activity, and start the app by clicking the icon, it will take me to the activity prior the the Result one. Why is this happening? Any workarounds?

    Read the article

  • Eclipse Juno won't create Android Activity

    - by MikkoP
    I downloaded Eclipse Juno Java EE edition and installed ADT plugin. I created a new Android Application Project from Eclipse and in the wizard I created an activity called TaskariActivity. After I pressed finish, it created the project but not the activity and the wizard didn't close. I pressed cancel. No activity or anything in the src folder. I created a new activity by right clicking on src, selecting new -> other -> Android -> activity. I selected BlankActivity (as earlier when I was creating the project), selected the earlier created project in the Project combo box. I set the Activity name as TaskariActivity, layout name as activity_main and title as TaskariActivity. Next I selected navigation type and I set it to Tabs + Swipe (I thought this would make me tabs and everything I had to do would be just inserting the elements and the actions for them). I pressed next, nothing happened. Finish didn't also do anything. I pressed cancel and an activity wasn't created. So, how can I create an Android application like in the earlier version of Eclipse? It automatically created the activity and it was ready be run out of the box. Now it won't generate any files and the new activity wizard doesn't work. Help?

    Read the article

  • Ubuntu Dependency Problem in Activity log Manager

    - by Incredible
    incredible@incredible-Inspiron-N5010:~$ sudo apt-get -f install [sudo] password for incredible: Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: activity-log-manager The following packages will be upgraded: activity-log-manager 1 upgraded, 0 newly installed, 0 to remove and 287 not upgraded. 1 not fully installed or removed. Need to get 0 B/60.3 kB of archives. After this operation, 29.7 kB disk space will be freed. Do you want to continue [Y/n]? y dpkg: dependency problems prevent configuration of activity-log-manager: activity-log-manager depends on activity-log-manager-common (= 0.9.4-0ubuntu3); however: Version of activity-log-manager-common on system is 0.9.4-0ubuntu3.1. activity-log-manager-control-center (0.9.4-0ubuntu3.1) breaks activity-log-manager (<< 0.9.4-0ubuntu3.1) and is installed. Version of activity-log-manager to be configured is 0.9.4-0ubuntu3. dpkg: error processing activity-log-manager (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: activity-log-manager E: Sub-process /usr/bin/dpkg returned an error code (1)

    Read the article

  • Passing Activity to non-activity object properly

    - by rayman
    In my app ive got a non-activity object which it's role is being a manager class. many times i need to pass "source activity" to methods as parameter to that manager class in order to make some operations on that activity. for exaple let's assume we have MyActivity which gotta do some toast. so i have this manager class called MyManager, and i have this method in it raiseToast(Activity sourceActivity) { Toast.makeText(sourceActivity, demo, Toast.LENGTH_LONG).show(); } and from Myactivity class we calling that method this way: MyManager manager=new MyManager(); manager.raitetoast(MyActivity.this); it works fine. what I'm asking here, is this a proper way to pass an Activity as parameter to a non-activity object? I'm having a memory leaks on real device(not the emulator), I wonder if this could also causing any reason for that? Thanks Idan.

    Read the article

  • Passing arguments from loading activity to main activity

    - by ZelluX
    I'm writing an application that starts with a loading activity. In the loading activity the app requests html from web and parses the html, then it sends the parsing result to the main activity. The main activity has several tabs, and contents of these tabs are based on the result of parsing. For example, the result of parsing is a list of strings ["apple", "banana", "orange"], and I need to pass this list to main activity, so that the main activity can create three tabs named after three fruits. I would like to know if there is any way to pass a list of strings among activities, BTW, is it the common way of do this? Many thanks.

    Read the article

  • Android back button does not restart activity?

    - by Chris
    My app intiates an activity. On the click of a button, the app opens up the browser with a webpage. When I hit the back button, it comes back to my initial activity screen, but does not resume or restart the activity. When I put all the layout code and activity code in onResume instead of onCreate, the activity gets restarted. My question is whether this is the right way to go about it? Can I use onResume to draw my layout and initiate the activity, or is this poor design? When the browser fires up, does the initial activity forget its layout? Please let me know what you suggest. Thanks Chris

    Read the article

  • Accessing previous activity instances in a sequence activity

    - by Dan Revell
    This has a rather SharePoint spin to it but the problem is straight workflow. I've got a parallel replication activity which contains a sequence activity. The sequence activity contains a CreateTask activity, a CodeActivity, a OnTaskChanged activity and finally a CompleteTask activity. The idea is to create a task for each username passed into the ReplicatorActivity.InitialChildData property. Typically in workflow I bind a field to the CreateTask.TaskId and CreateTask.TaskProperties and inside the CreateTask.MethodInvoking I set these through the local bound fields. This works and my tasks all get created properly. However in the CodeActivity that follows, I want to then access the TaskProperties. The problem I am encountering is that this field holds the values of the final task to be created as the CreateTask runs for all the replications before the CodeActivity gets to runs. From the CodeActivity, here are two ways I've tried to access the CreateTask activity instance from the same context or instance or whatever the terminology is for the replicated sequence. CreateTask task = ((CreateTask)sender.Parent.GetActivityByName("createSoftwareRequestTask", true)); CreateTask createTask = (CreateTask)sender.Parent.Activities[0]; Unfortunately the CreateTask activities both refer back to the last task to be created and not the task from the context that the CodeActivity is executing within. Two reasons why this might be that I can think of. I'm not accessing the correct instance with my code. I am accessing the correct instance, but as the properties I require were bound to and set through local fields then their previous data was overwritten. I'm hitting a brick wall with my understanding of workflow with this and would very much appreciate some assistance here.

    Read the article

  • WF -- how do I use a custom activity without creating it in a separate Workflow Activity Library?

    - by Kevin Craft
    I am trying to accomplish something that seems like it should be very simple. I have a State Machine Workflow Console Application with a workflow in it. I have created a custom activity for it. This activity will NEVER be used ANYWHERE ELSE. I just want to use this activity on my workflow, but: It does not appear in the toolbox. I cannot drag it from the Solution Explorer onto the workflow designer. I absolutely do not want to create a separate State Machine Workflow Activity Library, since that will just clutter my solution. Like I said, I will never use this activity in any other project, so I would like to keep it confined to this one...but I just can't figure out how to get it onto the designer! Am I going crazy!? Here is the code for the activity: public partial class GameSearchActivity: Activity { public GameSearchActivity() { InitializeComponent(); } public static DependencyProperty QueryProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Query", typeof(string), typeof(GameSearchActivity)); [Description("Query")] [Category("Dependency Properties")] [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public string Query { get { return ((string)(base.GetValue(GameSearchActivity.QueryProperty))); } set { base.SetValue(GameSearchActivity.QueryProperty, value); } } public static DependencyProperty ResultsProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Results", typeof(string), typeof(GameSearchActivity)); [Description("Results")] [Category("Dependency Properties")] [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public IEnumerable<Game_GamePlatform> Results { get { return ((IEnumerable<Game_GamePlatform>)(base.GetValue(GameSearchActivity.ResultsProperty))); } set { base.SetValue(GameSearchActivity.ResultsProperty, value); } } protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) { IDataService ds = executionContext.GetService<IDataService>(); Results = ds.SearchGames(Query); return ActivityExecutionStatus.Closed; } } Thanks. EDIT: OK, so I've discovered that if I change the project type from Console Application to Class Library, the custom activity appears in the toolbox. However, this is not acceptable. It needs to be a Console/Windows Application. Anyone know a way around this?

    Read the article

  • Android: Capturing the return of an activity.

    - by Chrispix
    I have a question regarding launching new activities. It boils down to this. I have 3 tabs on a view A) contains gMap activity B) camera activity C) some random text fields. Requirement is that the application runs in Portrait mode. All 3 tabs work as expected w/ the exception of the Camera Preview Surface (B). It is rotated 90 degrees. They only way to make it correct is to set the app to landscape which throws all my tabs around, and is pretty much unworkable. My solution is this : replace my camera activity with a regular activity that is empty w/ the exception of Intent i = new Intent(this,CameraActivity.class); startActivity(i); This launches my CameraActivity. And that works fine. I had to do a linear layout and include 3 images that look like real tabs, so I can try and mimic the operation of the tabs while rotating the screen to landscape and keep the visuals as portrait. The user can click one of the images(buttons) to display the next tab. This is my issue. It should exit my 'camera activity' returning to the 'blank activity' in a tab, where it should be interpreted to click the desiered tab from my image. The main thing is, when it returns, it returns to a blank (black) page under a tab (because it is 'empty'). How can I capture the return event back to the page that called the activity, and then see what action they performed? I can set an onclicklistener where I can respond to the fake tabs (images) being clicked to exit out of the camera activity. On exit, the tab should update so that is where you return. any Suggestions? Thanks,

    Read the article

  • Application stops on back button in new activity

    - by Bruno Almeida
    I have this application, that have a listView, and when I click in a item on listView, it opens a new activity. That works fine! But, if I open the new activity and than press the "back button" the application "Unfortunately, has stopped". Is there something I'm doing wrong? Here is my code: First activity: public class AndroidSQLite extends Activity { private SQLiteAdapter mySQLiteAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView listContent = (ListView)findViewById(R.id.contentlist); mySQLiteAdapter = new SQLiteAdapter(this); mySQLiteAdapter.openToRead(); Cursor cursor = mySQLiteAdapter.queueAll(); startManagingCursor(cursor); String[] from = new String[]{SQLiteAdapter.KEY_NOME,SQLiteAdapter.KEY_ID}; int[] to = new int[]{R.id.text,R.id.id}; SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this, R.layout.row, cursor, from, to); listContent.setAdapter(cursorAdapter); listContent.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Toast.makeText(getBaseContext(), id + "", Toast.LENGTH_LONG).show(); Intent details = new Intent(getApplicationContext(),DetailsPassword.class); startActivity(details); } }); mySQLiteAdapter.close(); } } Second Activity: public class DetailsPassword extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView text = new TextView(getApplicationContext()); text.setText("Text to show"); setContentView(text); } } // ===== EDITED ===== here is the Stack Track 10-30 08:55:05.744: E/AndroidRuntime(28046): FATAL EXCEPTION: main 10-30 08:55:05.744: E/AndroidRuntime(28046): java.lang.RuntimeException: Unable to resume activity {com.example.sqliteexemple2/com.example.sqliteexemple2.AndroidSQLite}: java.lang.IllegalStateException: trying to requery an already closed cursor android.database.sqlite.SQLiteCursor@4180a370 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2701) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2729) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1250) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.os.Handler.dispatchMessage(Handler.java:99) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.os.Looper.loop(Looper.java:137) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.ActivityThread.main(ActivityThread.java:4931) 10-30 08:55:05.744: E/AndroidRuntime(28046): at java.lang.reflect.Method.invokeNative(Native Method) 10-30 08:55:05.744: E/AndroidRuntime(28046): at java.lang.reflect.Method.invoke(Method.java:511) 10-30 08:55:05.744: E/AndroidRuntime(28046): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 10-30 08:55:05.744: E/AndroidRuntime(28046): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558) 10-30 08:55:05.744: E/AndroidRuntime(28046): at dalvik.system.NativeStart.main(Native Method) 10-30 08:55:05.744: E/AndroidRuntime(28046): Caused by: java.lang.IllegalStateException: trying to requery an already closed cursor android.database.sqlite.SQLiteCursor@4180a370 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.Activity.performRestart(Activity.java:5051) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.Activity.performResume(Activity.java:5074) 10-30 08:55:05.744: E/AndroidRuntime(28046): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2691) 10-30 08:55:05.744: E/AndroidRuntime(28046): ... 10 more

    Read the article

  • Android service puts multiple instances of an activity in the history

    - by HenryAdamsJr
    I'm making a music player. When you press play, it loads a notification into the OnGoing section. When you go anywhere else in the system, I want the music to keep playing. All of this is fine. The problem is that when I relaunch my activity from the Notification, it adds a task to the history stack each time, so if I hit back, I have to see the instance of Activity B from where I pressed play, and from every time I clicked on the notification to go back to Activity B. I want the instance of Activity B that I launch from the notification (via the service) to be the only copy of that Activity in the history. I've been playing around with various Intent flags and Activity attributes in the manifest, but I haven't found the proper combination.

    Read the article

  • Calling finish() After Starting a New Activity

    - by stormin986
    The first Activity that loads in my application is an initialization activity, and once complete it loads a new Activity. I want to ensure if the user presses 'Back' they go straight to the Launcher, and not the initialization screen. Side note, is this even the best approach, or would this be better done with some kind of Intent Flag? Is it correct to call finish() after calling startActivity() on the new activity? onCreate() { ... startActivity(new Intent(this, NextActivity.class)); finish(); ... } I'm still taking in the whole 'Message Queue' method of doing things in Android, and my assumption is that calling startActivity() and then finish() from my first Activity's onCreate() will log each respective message in the message queue, but finish execution of onCreate() before moving on to starting the next Activity and finishing my first one. Is this a correct understanding?

    Read the article

  • Android: forward search queries to one single activity that handles search

    - by Stefan Klumpp
    I have an activity handling search (ACTIVITY_1), which works perfectly when I use the search (via SEARCH button on the phone) within/from this activity. However, when I use search from another activity (ACTIVITY_2..x) by implementing onNewIntent and forward the query string to my Search_Activity.class (ACTIVITY_1) @Override protected void onNewIntent(Intent intent) { Log.i(TAG, "onNewIntent()"); if (Intent.ACTION_SEARCH.equals(intent.getAction())) { Log.i(TAG, "===== Intent: ACTION_SEARCH ====="); Intent myIntent = new Intent(getBaseContext(), Search_Activity.class); myIntent.setAction(Intent.ACTION_SEARCH); myIntent.putExtra(SearchManager.QUERY, intent.getStringExtra(SearchManager.QUERY)); startActivity(myIntent); } } it always pauses ACTIVITY_2 first and then goes to onCreate() of ACTIVITY_2. Why does it recreate my ACTIVITY_2 when it is already there and doesn't go to onNewIntent directly? Is there another way I can forward search queries directly to ACTIVITY_1? For example via a setting in the Manifest.xml Is it possible to generally forward all search queries automatically to ACTIVITY_1 without even implementing onNewIntent in all the other activities? Currently I have to put an <intent-filter> in every single activity to "activate" my custom search there and forward the query then to the activity that handles search via the onNewIntent (as shown above). <activity android:name=".Another_Activity" android:theme="@style/MyTheme"> <intent-filter> <action android:name="android.intent.action.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity>

    Read the article

  • Android: Adding data to Intent fails to load Activity

    - by DroidIn.net
    I have a widget that supposed to call an Activity of the main app when the user clicks on widget body. My setup works for a single widget instance but for a second instance of the same widget the PendingIntent gets reused and as result the vital information that I'm sending as extra gets overwritten for the 1st instance. So I figured that I should pass widget ID as Intent data however as soon as I add Intent#setData I would see in the log that 2 separate Intents are appropriately fired but the Activity fails to pick it up so basically Activity will not come up and nothing happens (no error or warning ether) Here's how the activity is setup in the Manifest: <activity android:name=".SearchResultsView" android:label="@string/search_results" <intent-filter> <action android:name="bostone.android.search.RESULTS" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> And here's code that is setup for handling the click Intent di = new Intent("bostone.android.search.RESULTS"); di.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // if line below is commented out - the Activity will start di.setData(ContentUris.withAppendedId(Uri.EMPTY, widgetId)); di.putExtra("URL", url); views.setOnClickPendingIntent(R.id.widgetContent, PendingIntent.getActivity(this, 0, di, 0)); The main app and the widget are packaged as 2 separate APK each in its own package and Manifest

    Read the article

  • Android Resume Activity

    - by George
    In my app, I start an activity and then on button click, display an http url (using Intent - VIEW_ACTION) So when in the middle of the activity, if the user clicks the button called "Google", it opens up google.com in the browser. When I hit the back button, it comes back to my original activity screen. How can I get my activity to resume from where it left of? Thanks George

    Read the article

  • android multiple activity declaration in manifest

    - by Brahadeesh
    Hi all. I have a main activity. From it, I am calling 2 other sub activities called FacebookLogin and Twitterlogin. I am using the following code in AndroidManufest.xml: ..... <activity android:name=".*****" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> </activity> <activity android:name=".FacebookLogin" android:label="string/app_name"> <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> </activity> <activity android:name=".TwitterLogin" android:label="string/app_name"> <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:scheme="yourapp" android:host="twitt"></data> </intent-filter> </activity> ..... Am i doing it right? Should i nest the FacebookLogin and TwitterLogin activities in the main activity? The aforesaid 2 classes are in the package com.examples.. * is the same wherever used.

    Read the article

  • Intercepting touch events on activity and button on Android

    - by hgpc
    I have an Android activity with an ImageButton. I would like to execute some logic when the button is clicked and show a different image for the pressed state, but also receive the touch event on the activity. By default only the button receives the touch event. If I set the clickable attribute of the button to false then only the activity receives the touch event. What's the best way to receive the touch event in both the activity and the button?

    Read the article

  • Activity gets killed while executing the camera intent

    - by BlackRider
    In my app I call the system camera to take a picture, and then handle the result in onActivityResult. You know, the usual. It used to work, but now my calling activity gets killed while I'm taking the picture. Specifically, onDestroy() is called on my activity right after I press the camera shutter. The photo does get taken & saved (I've checked that the file gets written on the SD card). After I accept the photo, instead of returning to the calling activity and invoking onActivityResult, the previous activity in the activity stack gets called. I see no exceptions in the logcat. My custom exception handler doesn't get called. If it matters, my app also includes a service that listens to GPS updates, but I unregister all the receivers in onPause(). Here's the call stack for MyCallingActivity.onDestroy(): Thread [<1> main] (Suspended (breakpoint at line 303 in NewPlaceDetailsActivity)) NewPlaceDetailsActivity.onDestroy() line: 303 ActivityThread.performDestroyActivity(IBinder, boolean, int, boolean) line: 2663 ActivityThread.handleDestroyActivity(IBinder, boolean, int, boolean) line: 2694 ActivityThread.access$2100(ActivityThread, IBinder, boolean, int, boolean) line: 117 BinderProxy(ActivityThread$H).handleMessage(Message) line: 968 ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 130 ActivityThread.main(String[]) line: 3687 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 507 ZygoteInit$MethodAndArgsCaller.run() line: 842 ZygoteInit.main(String[]) line: 600 NativeStart.main(String[]) line: not available [native method] This is how I start the camera activity, in case you're wondering: protected void startCamera() { createPhotoDirsIfNeeded(); String fileName = "temp.jpg"; ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.TITLE, fileName); m_capturedImageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); m_photoFileName = APP_PHOTO_PATH + "/" + DateFormat.format(DATE_FORMAT, Calendar.getInstance().getTime()) + ".jpg"; File picFile = new File(m_photoFileName); if(picFile.exists()) { picFile.delete(); } // start the camera activity Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(picFile)); startActivityForResult(intent, IntentHelper.REQUEST_TAKE_PHOTO); } How can I find out why does my activity get killed, AND removed from the stack instead of being created again?

    Read the article

  • Re-load Android activity data

    - by rhinds
    Hi, I am writing an Android app, part of which will be a survey involving multiple pages of checkbox question and answers. I have created an activity to display the question and options (from the DB) and what I want to do now is when i press the "Next" button it should just reload the current activity with the next question set from the database. (the activity starts with survey.getNextQuestion() - so its just a case of refreshing the activity so it updates) Im sure this is a simple thing to do -any ideas? Thanks

    Read the article

  • Intercept creation of activities when the application is restored

    - by Johan Bilien
    Most of our activities access a user-specific model. All these activities inherit from a ModelActivity base class, which provides a getModel() call. When one of these activities detect that the user has signed out (through the AccountManager callback), it sticks to its existing model, but prepares to exit back to the root activity (which is not user-specific) by starting its intent with FLAG_ACTIVITY_CLEAR_TOP. If however the user deletes an account while the app is not running, we run into trouble when the activity is restored. Now the activity needs to handle there not being a model, which makes the code more complicated and bug-prone. Ideally we would intercept the application restore process before the activity is created. Then we would check whether we have an account and a model, and if not clear up the saved stack of activities, and restart from our root activity instead of the last saved activity. But as far as I can tell the first place where we can run code is in the onCreate callback of the activity. Is there a way to run some code when the application is restored from background-saving, but before the saved activity is created?

    Read the article

  • How to pass the values from one activity to previous activity

    - by Kumar
    Dear friends.. Can any one tell me how to pass the value from one screen to its previous screen. Consider the case.i m having two screen first screen with one Textview and button and the second activity have one edittext and button. If i click the first button then it has to move to second activity and here user has to type something in the textbox. If he press the button from the second screen then the values from the textbox should move to the first activity and that should be displayed in the first activity textview. regards, s.kumaran.

    Read the article

  • Start Activity with an animation

    - by adityad
    I am trying to start an activity with a custom transition animation. The only way I have found out so far to do this (without using onPendingTransition() in the previous activity) is to use a custom theme on the activity and define either activityOpenEnterAnimation, taskOpenEnterAnimation, windowEnterAnimation or windowAnimationStyle to set the animation. But, none of these attributes are working for me. Some experimentation yielded the following results- If I set the windowAnimationStyle attribute to some custom style which defines values for activityOpenEnterAnimation, taskOpenEnterAnimation, windowEnterAnimation or windowAnimationStyle I can get rid of the default transition animation occurring at the start of the activity. It doesn't show the transition animation using the actual value specified but at least the default animation is not shown. According to the reference doc here, http://developer.android.com/reference/android/R.attr.html I should be able to define an animation at the start of the activity using activityOpenEnterAnimation. But no success so far. Any ideas?

    Read the article

  • Issues with start activity for result

    - by rodkarom
    I have written an Activity using Theme.Holo.Dialog so that it works as an AlertDialog as a login/password notice. I've started this activity with startActivityForResult(...) using a request code I defined. The thing is, whenever I start the activity ´onActivityResult(...)´ is triggered immediately, the buttons get loaded and everything, but once I press them, even though I know the Activity is working because login does happen, there is no result sent back to the first Activity and I am calling setResult(...) and finish() after the buttons are pressed. Thanks in advance, first time using startActivityForResult so I'm sure I must be missing something.

    Read the article

  • Child Activity in Android

    - by Martin Marinov
    So I have two Activities. The main is called Main, and the child one is called Child. When a button is clicked in the main activity it triggers the following piece of code: Intent i = new Intent(Main.this, Child.class); Main.this.startActivity(i); That opens the Child activity. As soon as I call finish() or press the back button within the child activity instead of going back to the main one, the app just closes. Can you give me a hint where the problem might be :( P.S. By trial and error I found out that if edit AndroidManifest.xml and add android:theme="@android:style/Theme.Dialog" within the declaration of Child the back button and calling finish() behaves as expected: closes the child activity and brings the main into focus. The problem is that when I start typing in an EditText the screen starts flickering (rather bizzare). So I can't use it as a dialog. My main activity uses the camera, so that might be making problems. Although when the child activity is started, the onPause event is fired and it stops the camera until onResume is called.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >