Android :: Closing Old Methods / Activities In Application

Nov 24, 2010

Need help closing/accessing my views in a simple app (included an img of my program layout) but I might have been too confusing. Basically, I have an app that has a main menu where the user can click a button to open a camera. The user then snaps a photo and it is displayed on a page. The user will then click another button that detects faces. If faces are detected, the user is sent to a final page that shows the cropped face, etc. I give the user the ability to return to the main menu or snap a new photo.

Let's say a new photo is snapped and the user does it a few more times. Now I have multiple saved instances of old snapped photos (presented on the layout). How do I kill the previous instance (the layout from before he decided to snap a new photo)? So when I try to close the app it doesn't go back to the previous instance (displayed layout of said snapped photo). I am so confused on this one thing.

Android :: Closing Old Methods / Activities in Application


Android :: Methods Not Working - Force Closing?

Nov 20, 2009

I've a couple functions that basically parse XML but it's not XML it is parsing something similar. I use them in PHP to break apart large strings so I converted them to Java for this, but when I use them they force close. I use this code to call them....
CODE:..........

That's the gist of it. I know the string "str" is good, checked it, but if I run these lines I get a force close, if I comment them out I do not. The methods are below. See anything wrong?

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

View 5 Replies View Related

Android :: Accessing Common Methods Among Activities

Jun 20, 2010

I have Activity A and Activity B. I want to access a method in Activity A from Activity B. This is my method:
Activity A extends activity{
public void save(){
} }

View 5 Replies View Related

Android :: Thread-safety When Creating Methods - Activities Which Interact With SQLite Database

Sep 20, 2010

I am creating an app which allows for many different Activities to be started from a TabActivity(up to ~25). Most of the activities require data from the sqlite database, so when onCreate is run, an AsyncTask creates an SQLiteOpenHelper object(which will open a readable/writable database), runs a query, data is retrieved, and everything is then closed.

I was just testing messing around to see if i could break something, so i added every Activityto the TabActivity's TabHost. I then started mashing each tab as quickly as possible.

I noticed that very quickly i began to see in the LogCat: Caused by: android.database.sqlite.SQLiteException: database is locked: BEGIN EXCLUSIVE; and the app proceeded to die.

Typically there will only be about 4-6 tabs(i can just limit the user anyway) for the TabHost. I haven't been able to break anything with a small amount of tabs to mash, but i am still worried that maybe i am accessing the database in a poor way.

How can i prevent my SQLiteDatabase objects to cause a lock?

If i create a ContentProvider will that eliminate the possibility of database locking?

Do you have any suggestions for changes I could make for accessing data from an SQLiteDatabase?

I ended up taking the approach of using the Application class and storing 1 SQLiteOpenHelper and trying my best to keep it synchronized. This seems to be working great - i put all my 25 activities in the TabHost and mashed away on them with no errors.

I am calling ((SQLiteDbApplication)getApplication()).setDbHelper(new DBHelper(this, Constants.DB_NAME, null, Constants.DB_VERSION_CODE)); method(shown below) in every onCreate() in my activities

Any further suggestions to this approach or to the changes i made using this Application class?

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

View 3 Replies View Related

Android :: Closing Several Activities Simultaneously

Mar 17, 2010

In my application you can navigate through several Activities until the Activity stack is quite deep.

We'd like a button on every Activity that will take you straight back to the main menu - i.e. pop all Activities from the stack except the first one.

I've put the button in a View that I can easily put on every Activity in the application, but I can't figure out how to close several Activities in one fell swoop.

(If possible, it would be good if the View could work out how many Activities to close by itself - i.e. detect how deep on the stack its own Activity is.)

View 2 Replies View Related

Android : Expose Methods Of An Application To Another Application

Jun 27, 2010

Is there any way to expose the methods of one application to another application in android. Suppose that I have written a slider for one application and if i want to use the same slider in some other application, How can I do it without copying the source.(Both the applications are installed on the device).

View 2 Replies View Related

Android :: Can A Native Application Use Java Methods In Telephony Manager?

Sep 17, 2009

I am currently working on porting a application written in C in android platform. I need to know that can i invoke/call the getSystemService from the C application using invocation interface by JNI. Meaning using a .java file which will interact with the interace provided by the android.telephony.TelephonyManager.java for using getCallState() and other mehthods.

View 2 Replies View Related

Android :: Create Custom Global Methods In My Application Class?

Aug 17, 2010

I currently have an app that has many activities and needs to have a way of maintaining state between these activities.

I use the Application class to do this, declaring my global variables and using getters and setters to interact with my activities.

I was hoping to place a few custom methods in there, so that when I want to do a common task like, for instance, display an error message, I can declare the method in my application class and call it from any activity that uses it

EscarApplication application = (EscarApplication) this.getApplication();

EscarApplication being the name of my application class above.

I have tried to include this method in my application class:

CODE:.....

In the hope that I can call this method from activity without having to redeclare it, but when I call it using something like below I get an null pointer exception:

Visit.this.application.showError("Update error", "An error has occurred while trying to communicate with the server");

Visit being the name of my current activity above.

Should this work, or can I only use getters and setters to change global vars in an Application Class.

EDIT Stack Trace:

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

The dialog is declared as such in the application class:AlertDialog alertDialog;

Created in that same class:alertDialog = new AlertDialog.Builder(this).create();

And the method to call it in that class is as follows:

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

And finally, it is called from an activity like so:

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

View 3 Replies View Related

Android :: When Do Synchronize Methods Or Use Synchronized Blocks In Methods In Android Game

Mar 14, 2010

I'm looking into writing simple graphics code in Android and I've noticed some synchronized() blocks. What is the reasoning behind this and how do I know when I should be "synchronizing" my code?

View 1 Replies View Related

Android :: Closing Application Window Programmatically

Aug 3, 2010

I am doing small project "Location Finder" in android.In that i have used different menu items,which include Close menu.On click of that menu i want to close the application.i have tried it with finish(),but it just the finish the current activity.

View 3 Replies View Related

Android :: At Time Of Closing An Application / How To Stop A Thread?

Jul 5, 2010

I use the following code to receive the data using UDP. When I click the back button my screen visual is closed and it shows the home screen. But a thread is working in the background (it receives the data from the UDP server). When I close the application I also need to stop the thread. How to stop a thread? Code...

View 2 Replies View Related

Android :: Stop Thread At Time Of Closing Application

Jul 4, 2010

I am new to android.At the time of closing application i need to stop the thread in android. Can anyone help me to solve this?

View 2 Replies View Related

Android :: Multiple Activities In Application

Mar 17, 2010

I seem to be missing something obvious here, why would I want more than one activity per application in Android? Does somebody have some solid examples?

View 3 Replies View Related

Android :: Activities In Application - Which Should Launch First?

Nov 9, 2010

I created an app with one activity, and it works just fine. Having though more about the app, I decided to add another activity which be the welcome screen of the app, with a nice logo and some buttons. This app should direct the user to the activity I mentioned before. The only trouble is - I can't find out where and how can I determine which activity should launch first, the moment the app loads. Do I need to create the entire app from scratch, but this time programing the home activity first?

View 1 Replies View Related

Android :: Kill An Application With All It's Activities?

Jun 23, 2010

I want to offer the user an option to exit the application as I need to delete some sensitive data, which is stored in the SharesPreferences as long as the application needs it.

As soon as the user wants to exit, the password in the SharedPreferences should be wiped and of course all activities of the application should be closed (it makes no sense to run them without the known password - they would crash).

How can I do that?

System.exit(0) and finish() only exit the current activity - useless. I know there is a taskmanager app. How is that one doing it? It's able to kill the whole application ...

View 4 Replies View Related

Android :: List All Activities Exposed By An Application

Nov 17, 2010

I think that it should be possible to get all the activities from 'third-party' application, described in the manifest file. I can't figure out how.

for example: List<Activity> aList = packManager.getActivitiesForPackage("package.name");

View 2 Replies View Related

Android :: Stop An Application If Any Of Activities Were Killed By OS

Sep 10, 2010

I have an application with many forms implemented as separate activities. The form variables are dynamically built based on a database, and there are a ton of variables in the C++ side of the application (accessed via JNI). I don't see how saving out all of this data to persistent storage each time the onPause() or the onSaveInstanceState() of one of these many activities goes into the background is a smart use of processor time. And I don't see how even if I save the local variables for each activity during that time I'd be able to restore a single activity within the context of all the others.

I have set up a service that auto saves the files when I detect that the app has gone into the background. (I set a time stamp when onPause() is called in any activity and then clear the time stamp when onResume() is called on any other activity. If the time elapsed is more than a few seconds, I know I'm not the top activity any longer and the service saves the files).

What I'd like to do is continue on as normal unless the OS kills one of my activities. Since we don't always get notified of this, I thought it would be nice if there were a way to tell the OS that I'd rather you kill the whole app than just one activity.

View 1 Replies View Related

Android :: Close All Activities In Tabbed Application

Feb 20, 2009

Can someone tell me how to close all activities running under a tab?My initial activity does not need a tabbed view. Therefore, to initiate a tab for the next (remaining) activities, I call a class that extends TabActivity, from the first tab.All this class does is to assign and call activities based on the tab click.Currently, to close all activities i am using StartActivityforResult.But in this case, while calling activites from the TabHost, setContent does not accept a result code as a parameter.Help me to solve this one. My application is stranded in a blank screen before closing. i.e. in the TabActivity class.

View 2 Replies View Related

Android :: Creating Options Menu Available To All Activities In Application

Jun 20, 2010

I want to have an options menu that is available to all Activities in my app (on pressing the MENU button). I've been doing this by creating it in onCreateOptionsMenu(Menu menu) for each Activity but this seems redundant. Is there a way to create it in one place and have it available in all Activities?

View 1 Replies View Related

Android :: Application Background Image With Transparent Activities

Oct 29, 2010

I have run into an requirement of my application that i cant find a way to do this.

I need my application to be fullscreen and no title bar (done), and this application will have a background image. However, all the activities/views of my application must be transparent/translucent so the application background will be visible all the time behind the information i am displaying.

Basically i would like to have this behavior

http://www.geeky-gadgets.com/wp-content/uploads/2010/05/amazon-kindle-android-app.jpg

supousing that the image you see is not the phone wallpaper, but the application background image. What would be the application configuration in the manifest file and what would be the configuration for eacy activity/view?

I also noticed that, i need to setup each activity to be fullscreen without title bar. Is there a way to do this globaly in the application so all activities will behave this way?

View 1 Replies View Related

Android :: How Do I Get Multiple Icons To Launch Different Activities In One Application?

Jul 17, 2010

I have an application with two activities and I'd like to be able to have two icons appear in the launcher, each launching the respective activity within the app.Specifically, I want one icon to launch my main app, and another icon to launch my settings activity. Is this possible?This creates two launcher icons, but they both run my main app instead of the second icon running my settings app. I've tried just having the launcher category but then I don't get an icon so it looks like I need the main action as well.Is this the right approach or should I be declaring two applications in the manifest instead?

View 2 Replies View Related

Android :: Subactivity - Created An Application Which Consists Of Several Activities

Aug 3, 2009

I created an application which consists of several activities. If I start a subactivity named DlgTitleTags from main activity everything goes well.

Another case is when I start a subactivity DlgLibrary and then from DlgLibrary DlgTitleTags the execution fails on line:

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

In the first example this line executes without errors so I'm wondering what could be wrong here.

This is the copy from log:

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

View 1 Replies View Related

Android : Application With Multiple Activities - Single Launcher

Oct 6, 2010

I have an application which has multiple activities associated with it. When the user clicks on the launcher icon I want the last used activity of the application to be shown.

What's the best way to accomplish this?

View 1 Replies View Related

Android :: Pass Data Between Activities In Droid Application?

Jun 3, 2010

How to pass data between activities in an Android application?

View 1 Replies View Related

HTC EVO 4G :: Qik Force Closing - Application Stopped Unexpectedly?

Jun 4, 2010

I keep getting a message saying the application stopped unexpectedly. I've restarted the phone, and it is still popping up every time I try to start Qik.

View 23 Replies View Related

Samsung Vibrant :: Web Application Force Closing

Aug 29, 2010

I was trying to view a regular PC version of a site and somebody in a comment said its easier to fake a User Agent through about:debug so I did and no since I changed it to desktop it wont open and force closes. I saved a log of the crash if you guys want to see it. I just came from the iPhone world so this stuff is a tad different.

View 3 Replies View Related

Jelly Bean :: Application Closing For No Reason

Mar 8, 2014

Everything is okay but when i'm testing the application even on the emulator, i get a message "Unfortunately, application <something written>"

I tried debugging the code and found that Even after declaring a statement findViewById(), my variables are pointing to null. And i think that's the reason for this error.. heres my code, in MainActivity.java.

Code:

public class MainActivity extends ActionBarActivity {
TextView sum;
Button increment;
Button decrement;
int total;
@Override

[Code]...

View 3 Replies View Related

Android :: Share Files With Different Activities Running / In Different Processes In Application

Mar 16, 2010

I would like to share a cache file across activities, which are running in different processes but in a same application.So, is there any way to make it thread safe (probably not "thread safe", should we call it "activities safe" or "process safe" ?

View 2 Replies View Related

HTC Desire :: People Application Keeps Force Closing Due To Facebook

May 30, 2010

My People seems to be syncing with Facebook fine (their status updates show up, and it uses their FB profile photo), but when I select "View Facebook Profile", I get the following error message: "The application People (process com.android.htccontacts) has stopped unexpectedly. Force Close."

View 5 Replies View Related

Android :: Design Application With Multiples Activities And Operations Running In Background?

Nov 22, 2010

I am designing an app that will have some activities separated in tabs. Some of them will have to perform tasks in the background will the user is in another tab. What is the best strategy for designing an app like this? I was thinking about using a service but it can be killed by android dalvik, isnt it?

View 1 Replies View Related







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