activity

Start an Activity with a parameter

Hello. I'm very new on Android development. I want to create and start an activity to show information about a game. I show that information I need a gameId. How can I pass this game ID to the activity? The game ID is absolutely necessary so I don't want to create or start the activity if it doesn't have the ID. It's like the activit...

How can I call one method in two activities?

I'm developing an Android project , the main activity well call a method(Ptime.GetDate) which will change a global variable (output) then this activity will print this variable public class calendar extends main_menu { int i=0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle sav...

Do I still have to pass the ActivityContext to the AsyncTask in order to manipulate Views?

This function runs on the UiThread, but it seems that doesnt mean it also has access to the activity context. Shall I implement to my AsyncTask a public Setter to pass the activity (as reference)? protected void onPostExecute( Bitmap bitmap ) { //following is underlined red due to missing context (ImageView)findViewById...

Android Intent Activity crash behaviour - app restarts halfway through the app

I have a pretty standard iPhone app that creates a series of around 7 unique Activities initialised by Intents. However if the app crashes on the 7th Activity, the app restarts on the users phone around the 5th activity. The problem then is the info gathered from activities 1-4 is null, meaning the app is useless and the only way to get...

Android - Fadeout animation for splash screen

Hi Guys, I want to add fadeout animation for my splash screen, that is while closing the splash screen I want to bring the fadeout animation effect. Here are the codes which I have tried. overridePendingTransition(R.anim.fade_in, R.anim.fade_out); But the above can be used only from 2.0. Ny app should support from 1.5. So I have se...

Android : On application exit?

Hi, I understand when an activity closes, onDestroy() is called. But this is not done always right? Sometimes, onPause() is called. So suppose I want to clear some memory when an activity closes, where exactly do I do it? Since onDestory may not be called, I cannot keep it there either right? Elaborating: I have 2 activities A1 and A2...

[Android] Activity problem

Hi guys, I have 3 activity in my application. My first activity (Main) has 2 button that starts other activities (One & Two). The One Activity starts a countdown timer on UI. When I click back button Android closes this activity and when I re-open activity, my timer is resetted. I try also overriding: public boolean onKeyDown(int k...

Multiple threads in Android activity/service

Hi. I have an android app, where in a list view for each element in list, I load an image from web in a separate thread. So if there are 8 items displayed in list view, activity will try to fire 8 different threads, one for each list item to load an image. As you scroll down the list, the number of threads may increase if the previous t...

How to return from preference screen to main activity?

Hi. I have one main activity and one preferenceActivity. On my first activity I call menu and go on preferenceActivity by calling startActivityForResult. case R.id.settings: startActivityForResult(new Intent(this, SettingsActivity.class), LAUNCH_SETTINGS); return true; Then I change my ...

service displays points on map android

hello, i have a android service running in the background which receives the coordinates from the server every few seconds. i am not sure how do i display the coordinates on a map every time the service receives a response from the server. kindly help or give an idea. thanks ...

Problems making a new Activity in my application

Hi i have a button, and i want that when i click on it a new window appear. The class for the new windows is HelloGoogleMaps.java i add the class to manifest, and the class extends MapActivity i make the intent in the main class with this: Intent i = new Intent (this, HelloGoogleMaps.class); but an error appears: The constructor Int...

Android: How to pass ArrayList<customObject> between Activities?

Hi everyone! How can I pass a Object: ArrayList from one Activity to another? Seems that intent cannot hold custom ones except ArrayList. As a kind of hack, I use a static member: staticResultList = new ArrayList<SingleExamResult>(m_examResults); and Get it in the following Activity by: m_examResults = DoExam.staticResultList; I...

Android:How to change opened tab dynamically

Hi, I have an Android application which has four tabs (I use a main TabActivity with TabHost and TabSpecs). In one of my sub activity (activity opened in a tab), i need to open a tab not by clicking on the tab title and i don't know how to do this. For example, i have a button in my activity and when i click on it, it opens a different t...

Using a Intent to call an activity from another program results in Permission Denied

In my very simple app (based on the default Hello World app but with a button added) I try to open one of my phone's (a SE X10 Mini) preinstalled activities, like this: Intent calendarIntent = new Intent(); calendarIntent.setClassName("com.sonyericsson.calendar","com.sonyericsson.calendar.dayview.DayActivity"); startActivity(calendarInt...

Interactivity Coordination: onStop and onResume

I have two activities. One loads all rows from a database, and the other saves to the database. When I have the second save in onStop and the first repull the data in onResume, they do it out of order (the first resumes and then the second saves). I managed to fix this by putting the saving data in onPause, but why was this happening? Wa...

Is there another class in android that can replace the activity call throught which I can access SharedPreferences?

I'm have a User Class in my Android application that pulls out information from SharedPreferences I find myself instantiating the class within an Android Activity User currentUser = new User(this); I then go on to use the context to get the preferences. userName = context.getSharedPreferences("UserName", Context.MODE_PRIVATE); I ha...

How i can pass a parameter to an activity that i am creating from other activity?

Hi i have a main activity that is creating another activity (with googlemap) i have to pass my googlemaps activity a parameter, but i dont know how i created a constructor in my googlemaps activity with the parameter but... how i can call that constructor? i dont know how to do that because i only know one way to call an activity and...

How do I listen to Android's contacts launch activity?

I want to know when Android's contact launch activity is opened because my application opens after a call is finished and then the contact launch activity is opened after it meaning it will cover my app's activity leading to that I have to press "back" button to see my app. That is, I want to open my app after contact launch activity ha...

How to exclude my own Activity from Activity.startActivity(Intent) chooser ?

My app works with pictures. It can take multiple pictures as an input, process them, and send them again to another app. As a consequence, my main Activity has declared an intent filter on ACTION_SEND_MULTIPLE for image/* mimetypes and can result in issuing a new Intent with the same action and data type using Activity.startActivity(Int...

Suggestions to improve Activity Performance?

friends, i am using following global variables in my activity private String Session_ID; private String uid; // menu item starts private final int Trash = 0x003; private final int More = 0x005; private final int SignOut = 0x006; private final int SignIn = 0x007; //menu item ends private EfficientAdapter adap; p...