Android :: Open Dialogue Activity Without Opening Main Activity Behind It

Jul 19, 2010

Im writing a program that offers a quick reply dialog upon receipt of an SMS.

However, I am getting an unexpected result. When I receieve an SMS, the appropriate dialog activity comes up displaying the correct phone number and message, however there is a second activity behind it that is the 'default' activity in my program (it is what opens when i launch my application)

I do not want this second activity to come up. The quick reply activity should come up by itself over top of whatever the user was doing before.

The 'floating' activity:

CODE:.........

The call to the activity inside an onReceive()

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

The Manifest:

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

Android :: open dialogue activity without opening main activity behind it


Android :: How To Make Launcher Open Main Activity?

May 26, 2010

I have activities A and B. The A is the one with LAUNCHER intent-filter (i.e. the activity that is started when we click the app icon on home screen). A launches B using start Activity(new Intent(A.this, B.class)). When the user has the B activity open, and then put my application into the background, and later my application's process is killed, when the user starts my application again, B is opened instead of A. This caused a force close in my app, because A is the activity that initializes the resources my app needs, and when B tried to access the uninitialized resources, B crashes.

View 1 Replies View Related

Android :: Open An Intent - MapView - From Main Activity With Menu

Jan 13, 2010

I'm trying from main Activity (MainFile.java) to open a Map as a new intent through a menu. Something like this...

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

And I already have set up thing on my manifest.xml with access to...

CODE:........

It worked fine with other File.class, but with the Map.class doesn't seem to be working.

View 1 Replies View Related

Android :: Opening Browser Activity / Prevent It From Being In Activity History

Aug 12, 2010

I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization. This process uses a callback url which will re-launch the activity that started the browser activity in the first place.My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferences activity that launched the browser in the first place, they don't go back to the app's main activity, but instead are brought back to the browser. I've tried adding flags to the launching intent to prevent history and reset on clear, but it doesn't seem to work when running on my phone, only on the emulators.

View 1 Replies View Related

Android :: Passing Arguments From Loading Activity To Main Activity

May 16, 2010

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?

View 2 Replies View Related

Android :: Start Activity When Main Activity Is Running In Background

Jan 10, 2010

I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).

I tried to enabled it the following way:

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

This is the method from main activity. When onPause() is executed isRunningInBackground is set true.
When I tried to debug it when the main application was running in the background the line

startActivity(intent) had no effect (the activity didn't appear).

Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?

View 1 Replies View Related

Android :: Starting Second Activity From Main Activity On Button Click

Dec 4, 2009

Need an example of how to create/start a new activity from the main activity. I have a button click event on the main layout. Originally I just used setContentView(R.layout.secondactivity); which brings up the layout but I don't think that is correct since the secondactivity class is not instantiated at this point yet. I have looked for such an example and can not find one.

View 3 Replies View Related

Android :: App Widget Configure Activity Opens Main Activity

Jan 10, 2010

I hav an app that is like a relational database. There is a main app activity that users manage things with. There is also a widget that will display important info and add data to the database. When the widget is clicked, a configure class displays a way for the user to edit data. When the configure activity is done, the widget is updated and instead of going back to the home screen, the apps main activity is started. I can't find where the main activity is being called from. Wouldn't I have to create an intent and start Activity() to get this behavior? When done updating, I want the home screen and not my app.

View 3 Replies View Related

Android :: Main Activity To Browser Activity Error

Nov 7, 2010

I have a main activity, then i call a new activity intent from this. Lets call this SecondActivity. Then from my secont activity i call a browser intent. Then my browser intent call my second activity's onNewIntent method.Evereything work fine, but when i click on "back" button on my phone on my second activity, i will not going to my main activity, but the browsers activity, why?

View 1 Replies View Related

Android :: Opening A Resource Outside An Activity?

Aug 4, 2010

I am trying to open a Resource by passing the result of context.getResources().getString(R.drawable.myimage) to another class that is not an activity. context.getResources().getString(R.drawable.myimage) returns res/drawable-mdpi/myimage.png However, when I try and open this file, it throws a FileNotFoundException. What is the proper way to open a resource outside an activity?

View 1 Replies View Related

Android :: Intent Not Opening Correct Activity

Aug 22, 2010

I'm having a struggle understanding why my intent is not working. I basically just copied paste from other examples in my code that work perfectly like this. Here it is:

Intent addIntent = new Intent(v.getContext(), thenNnowMode.class);
Bundle w = new Bundle(); String activityName = "addPic";
w.putString("activity", activityName);
w.putParcelable("bitmap", selectedDeviceImage);
//a.putString("id", picId); addIntent.putExtras(w);
startActivity(addIntent); finish();

The intent is opening a different class called thenNnow.class instead of thenNnowMode.class and I have no idea why this is happening. I've tried sending the intent to open other activities other than thenNnowMode but it always opens thenNnow. Am I missing some silly syntax mistake? It's so strange, its the same code. I am not sure if it's relevant but the thenNnowMode class uses the device camera

View 23 Replies View Related

Android :: Opening A Second Activity And Fails To Launch?

Apr 12, 2010

What i'm trying to do is to open an Activity when i click on a button.

This is my code in my main activity.

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

The program launches no problem when i just implement the first button (restuarant).

But when i try to implement the button that i have commented out it fails to launch. and yes i have added the activity to the manifest file.

View 1 Replies View Related

Android :: Opening Another Activity From The Map Overlay Dialogs

Jul 22, 2010

I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.

I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.

I tried to start a new intent but it gives me an error.

Here is what I am doing

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

Here is the stack trace

CODE:........

Why am I getting this error and how can I resolve this and open a new activity? Also where can I find the source code for the google maps on android?

View 1 Replies View Related

Android :: Getting An Asset Outside Of Main Activity

Nov 30, 2009

From digging around a bit, getAssets() is an inherited method from ContextWrapper. It returns an AssetManager, and using open() it can return an InputStream. What I'm attempting to do at this point, is use the GLSurfuceViewActivity, Cube and CubeRenderer to work and learn off of and read in vertex data from a binary file. I've already created the binary output by parsing a model obj file and added to the assets directory. My Shape class (modified from the Cube class) does not have access to calling getAssets() since it's not a subclass of Activity or ContextWrapper. Once I accepted that, I tried to think of the best way to read in the data (without storing it extra places) to the Shape class. What I did, and seems to be working okay, was modify the Shape and ShapeRenderer constructors to accept an AssetManger as a parameter.

View 3 Replies View Related

Android :: Application Without Main Activity?

Oct 5, 2010

Is there a way to manage application activities by hand, like this: user activating an application from menu, it does some initialization, then creates some activity (is it necessar y to declare all activities in the application manifest?), and listens to it's events. On some event application decides to close one activity and open another - so it contains all the application logic. Didn't found anything like this in examples, they all have all the logic in the activity classes. Maybe I need to user Services? (Maybe I don't understand right, what an activity represents. For me it's like window in windows, or Displayable in j2me) I'm very new to android development, trying to understand the basics.

View 4 Replies View Related

Android :: How To Tab In Activity To Display Main.xml?

Apr 6, 2010

I am trying to make a app with the tuotrail of the developerspage, then I would like to display a main.xml in a tabview, instead the textview, wich in the tuotrail,is in the activity.How do I tell my tab in activity do display the main.xml?

View 1 Replies View Related

Android :: Keep Soft Keyboard From Opening On Activity Launch?

Jun 14, 2010

In an Android app, whenever the activity launches, the textbox gets the focus and the soft keyboard pops up automatically. I have tried to stop this by using following line in onCreate method, but it does not work.

((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(EditText.getWindowToken(), 0);

View 4 Replies View Related

Android :: Opening A Context Menu In OnCreate Of An Activity

Aug 9, 2010

I have a need to capture some user input when an activity opens for the first time. I'm hoping to give the user a list of options to select from, which will be pulled in dynamically. I'll then store the selected value locally for future use. I'm not finding a way to do what I'm after and was wondering if anyone has run into this before and how they solved it.

Fantasy Football<http://chriswstewart.com/android-applications/fantasy-football/>- Android app for fantasy football fanatics and MFL owners Social Updater<http://chriswstewart.com/android-applications/social-updater/>- An easy way to send your status blast to multiple social networks

View 9 Replies View Related

Android : How To Dynamically Choose Which Activity To Launch When Opening App?

May 5, 2010

I am writing an app that requires you to be logged in to a service before using it. From my understanding of android so far, you have to choose which activity to launch when you open from the launcher in the manifest. I don't know which activity i want to launch at compile time. I want the user to click the icon, then I check and see if they're logged in, then decide based on that whether to launch the login activity, or the main app activity. Is there a way to do this?

View 1 Replies View Related

Android :: Service Updating Main Activity Gui

Aug 24, 2010

I have a service which collect data and send them to a certain URL and updating the main activity GUI, so which is better in the performance to use a long service with listeners to collect the data and threads in it to update the GUI and sends to the internet or to make another service responsible for updating the GUI and sending to the URL only while the first one just collects the data?

View 5 Replies View Related

Android :: Service Bound To Main Activity

Nov 11, 2010

so the application I've written has a service (that tracks GPS data) with a single main activity that binds to it with bindService in it's onStart() method, and unbinds from the service in it's onStop() method using unbindService( ServiceConnection ). I also have an activity which is an options screen, that is launched by pressing a button on the main activity. On this options screen, I have a checkbox that says "Run in background", which, if set to true, means that when the user exits the application with eier the Home or Back buttons, the service will continue running, not turning the GPS off. I do this by calling this.startForeground onUnbind, and this.stopForeground onRebind, if the setting is set to true, and stopping and starting my location reader onUnbind and onRebind respectively if the setting is false. If the service is running in the background, it also displays a notification to ensure the user understands that the GPS is still running and draining their power. This notification is displayed and stopped by relying on the startForeground and stopForeground methods......

View 1 Replies View Related

Android :: How To Come Back Main Activity From Child One?

Mar 30, 2010

I'm in a small problem.i have three activities (suppose A,B,C) after performing onclick event in activity A, i can go to activity B and then C..my question is that is there any way to comeback activity A from C..here is the code snippet public void on Create(Bundle Code...

View 3 Replies View Related

Android :: What Is Recommend Way To Get Main Activity From Child One?

Mar 29, 2010

My android application has 1 main activity. And it launches some sub-activity (which I wrote) and that also launches some sub-activity (which I wrote). I do this. My question is how can each of my sub-activity and sub-sub-activity get back to the Parent activity? Code...

View 2 Replies View Related

Android :: Initialize Preferences From XML In Main Activity

May 20, 2010

My problem is that when I start application and user didn't open my PreferenceActivity so when I retrieve them don't get any default values defined in my preference.xml file. Code...

View 3 Replies View Related

Android :: Push New Instance Of Main Activity?

Sep 2, 2010

Is it possible to create/push-onto-stack a new Activity of the same main Activity in an Android application with an argument passed to the Activities constructor? Specifically from a Dialog object...

View 1 Replies View Related

Android :: Email App Switch Its 'main' Activity?

Dec 4, 2009

In android Email app, when I first launch it, it will shows me the 'account setup wizard' activity. But when I launch the Email app(after the account is set) again, it wont' show the 'account setup wizard' activity, it will show the 'Folder list activity ' instead.

How can it does the main activity switch (depends on the email account setup)?

View 2 Replies View Related

Android :: Call Main Activity From BroadcastReceiver?

Oct 28, 2010

While developing an alarm based application, i have stuck in a scenario.

When my alarm is fired, i can receive the event in BroadCastReceiver::onReceive().
Within this function, i want to notify/call a function, which is located on MainActivity.

How to achieve the same?

View 1 Replies View Related

Android : How Can I Change Main / Launch Activity?

Jul 13, 2010

I think I already know the answer to this, but I just wanted to confirm (I think no horrible ramifications)...

View 5 Replies View Related

Android : Can App's Main Activity Be Bypassed On Launch?

May 9, 2010

Are there any scenarios on Android where a process can be instantiated (classes loaded, etc.) and a non-main activity launched without going through the main activity? Background: my app has a single main activity (android:name="android.intent.action.MAIN" and android:name="android.intent.category.LAUNCHER"), some secondary activities, and a preferences class providing static methods meant to be called from anywhere. These static methods' implementations require a Context, and so the class has a static Context member s_context; the static methods assert that s_context is non-null before using it. The very first thing I do in my main activity's onCreate() method is pass getApplicationContext() into the preferences class so it can set s_context.

View 2 Replies View Related

Android : Get Screen Dimensions In Main Activity?

Jun 19, 2009

I created some custom elements and I want to programatically place them to the upper right corner (n pixels from the top edge and m pixels from the right edge) therefore I need to get the screen width and screen height and then set position:

int px = screenWidth - m;
int py = screenWidth - n;

Does anyone know how to get screenWidth and screenHeight in the main Activity?

View 3 Replies View Related







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