Android :: Creating An Object - Multiple Of Same Instance
Oct 19, 2010
I created an Matrix object (like the math Matrix, a 4x4 block of numbers for instance) and it works fine, can set row,col,variable just fine, but, I cant have more than one of the same object, I have it creating an ArrayList of a dozen Matrix objects, each with the three variables, but when I call changeVar(Matrix x,int variable) and refresh the printout of the matrix, it changes all of the numbers to what i changed the variable to. So it looks like its just creating the same instance over and over, and if you change one, it changes them all, am i missing anything obvious?
CODE:........................
View 3 Replies
Jul 8, 2010
I have Class in having an abstract class object as a field in JAVA layer. I want to set this field From Native code C++. I am Trying to use SetObjectField() to set, but it does not work out. Does anyone try this before or know who to do it please shed some light on it.
View 2 Replies
View Related
Jul 4, 2010
I have few question in application side. Questions are below 1. Can LMK (Low Memory Killer) kill service ? 2. Can I open multiple instance of same applications ? 3. Can I set the priority for the application? 4. LMK kills application(process) or one activity(suppose in application 4 activity). If it can kill activity then how activity stack handling this.
View 3 Replies
View Related
Jun 4, 2009
I am learning the app widget programming in the 1.5 SDK release. I was playing with the sample widget (wiktionary) and found out that you can actually add multiple instance of the same widget to the home screen, is there a way to prevent this? An attribute in the XML? I am stuck with 3 instance of wikitonary and 2 instances of music player on my emulator now... can't get rid of them... :(Also I am looking into buliding my own app widget container, not a home screen replacement, just a container that can host other widgets, I read the appwidgethost api doc, is there any sample code or guide on how to use the appwidgethost api
View 3 Replies
View Related
Jan 27, 2010
Why when I look at a contact n go to edit, why is there many "google contact" instances all for the same contact. Like it has their name numbers n email then keeps scrolling and has multiple per contact. Why is that and can I do away with them..
View 3 Replies
View Related
May 25, 2010
I need to be able to use one object in multiple activities within my app, and it needs to be the SAME object. What is the best way to do this?
I have tried making the object "public static" so it can be accessed by other activities but for some reason this just isn't cutting it. Are there any other ways of doing this?
View 6 Replies
View Related
Jun 9, 2010
I have to dynamically add a list of views (the views use RelativeLayout). Can I do this by specifying the view definition in xml and instantiate multiple objects off it? This gives the usual benefits of separating the view part from the code (for e.g., making it easy for the UI guys to alter things) or Is going the ArrayAdapter the suggested/only route?
View 1 Replies
View Related
Feb 22, 2010
How to create two or more tables in one database in single class which extends sqliteopenhelper in one function oncreate.
View 2 Replies
View Related
May 4, 2010
Are there any viable approaches for creating multiple .APKs out of a single codebase? The apps may share the same code, but they could have different manifest files, different resources, or different external libraries (for example in an app with both free and paid versions, the free version could have a library for display ads). Ideally, this would be a single Eclipse project, with a way to specify which app to build/debug, and possibly a command line way to batch build everything.
View 16 Replies
View Related
Mar 25, 2009
I am new to android and trying to create a customized list. Every item in the list has TextView and one Ratingbar. I now want add a couple of command buttons at the end of the list (like BACK, HOME, , NEXT). When I add these extra views to the layout xml file then they get added along with every item in the list. I think there should be another layout defined for the buttons to be displayed separate from the list. Anyone has an idea on how to do this?
View 2 Replies
View Related
Aug 20, 2013
First noticed a problem when I got a warning message that I was running out of storage space on the phones memory. When I checked I found literally thousands of copies of the same photo in the S4PhoneDCIMCamera folder. I delete them all but the phone continues to make a copy approximately one every minute which I have to constantly delete to free up storage. what is making the copies? Galaxy S4 4.2.2 kernel 3.4.0-10811224 basband Ver I9505xxubmga
View 3 Replies
View Related
Mar 17, 2012
So basically the title says it all. I looked everywhere tried everything but hard reset my phone(htc amaze) and every time I create a new message i have 3 of the same contacts each time.
For example If I type in the letter "a" as a contact I would of "a" 3 times etc... I just cant figure out what the problem is. Idk whats wrong with it.
View 3 Replies
View Related
Sep 9, 2009
I want to do some automated testcase with Instrumentation . Suggest that my AUT has 2 Activity. After clicking the button in ther first Activity, the second one will be shown with new content base on what we enter in the first Activity.) Instrumentation provides us the function called startActivitySync() and return the Activity object for processing. My question is how we can get the pointer of the second Activity after the it is shown by clicking the button on the first activity.?
View 2 Replies
View Related
Jun 8, 2009
I would like to convert a Picture object to Bitmap object in memory, without writing data to disk.
View 2 Replies
View Related
Sep 21, 2009
I have an Activity that running on system. I can get the Intent that is used to start the activity. But i don't know how to get the Activity object from the Intent object or something else. Can anyone tell me how to do this??? Note that, I don't use Instrumentation object.
View 11 Replies
View Related
Feb 18, 2009
I am trying to get a FileInputStream object on an image that the user selects from the picture gallery.
This is the android URI returned by android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI content://media/external/images/media/3
When I try to construct a java URI object from this object, I get an IllegalArgumentException with the exception description Expected file scheme in URI: content://media/external/images/media/3 whereas the android URI shows the scheme as content
Never found a solution for the original question. But if you want the byte stream of an image in the pictures gallery, this piece of code will do that.
CODE:...................
View 4 Replies
View Related
Apr 2, 2009
My application has 2 activities. The main activity will create the "child" activity through startActivityForResult((...). When the child activity needs to exit, it calls setResult(..) and finish(). Child activity will start and exit multiple time upon user selection. The activity are start and exit as expected and onAcitivtyResult(..) also got invoked.
However, I found a problem with child activity, when the child activity was created the second time ( Main activity called startActivityForResult(...) upon some user event ), a new instance of child activity was created, but the displayed is the FIRST instance child activity! ( so any state in second instance of child activity was not accessible ). The onKey(...) was always go to first instance of child activity. Make things more interesting, the getInstanceCount () returns 3.
I have checked the code and no where holds the first instance of child activity which should be garbage collected after finish().
View 3 Replies
View Related
Apr 9, 2009
Is there a way to prevent the user of opening more than one instance of my application?
For example: User clicks on App and opens it. The user clicks on the home button. (the app is still running in the background) The user clicks on (not the menu button, but the button above it in the homescreen), and then opens the application again. Does it open the same instance, or does it create another one? If it does create another one, how can I prevent it from creating another one, and just opening the existing instance?
View 6 Replies
View Related
Jul 9, 2010
Is there a way to get an instance of the activity that has called the currently running activity from the intent object that has been passed to it? eg. if A has called B, I would like to retrieve A's instance from the intent in B's onCreate method. As Activity is not Serializable i am not able to pass the instance in the extras bundle.
View 1 Replies
View Related
Sep 7, 2010
I have two activities.A and B. A starts B.Both are running in the screen and both are visible. Say now B is visible.
On a special key press, I want to bring the A to the front and make it active. The problem I am facing is when the special key is pressed, another instance of A is launched and the new instance is brought to the front.
But I want the original A to come to the front. I want to make this change in the framework layer rather than application specific by using the singleInstance theme in the launchMode in AndroidManifest file.
View 5 Replies
View Related
Aug 16, 2010
Are there design guidelines to help decide if an application with multiple views should be designed with multiple activities or just one activity and control the back button itself.
I've tried both. My most complex applications using one activity per screen. However, now that I'm successfully written an app with just one activity and handling the back button myself, I don't see any compelling reason to use multiple activities. The one activity application is much simpler and more straightforward.
What advantages of multiple activities am I missing?
View 8 Replies
View Related
Jun 24, 2010
Is there a way to know if there is an instance of your widget currently on the homescreen? I always end up using variables that change state with onUpdate() and onDeleted() calls, but that obviously that isn't effective in every scenario.
View 9 Replies
View Related
Nov 22, 2010
I have referred the example given on: http://goo.gl/1uxXv , But it is not showing the exact DatePicker dialog as given in the book example, what i should do to display the same dialog box or Calendar instance in my application ?
View 4 Replies
View Related
Nov 6, 2009
Im creating a mail application, where i need to start a service instance for every account, which will check for the new mails for that account. Now my problem is that i want to identify how my service i have created so far (by calling startService()). And also i want to stop a specific instance of service. I know that calling stopService() will stop all the instances of that service. Is there any work around to it.
View 2 Replies
View Related
Nov 17, 2009
I am trying to do the following.
I have an Image viewer where in the user picks an Image from within the gallery. The uri to that selected Image is available to me. Now, I want to use this URI information and send it as a file over a socket using FileInputStream. Is this a valid syntax to perform the above action?
CODE:..............
View 10 Replies
View Related
May 9, 2010
I have a bunch of tab activities (which I implemented myself, didn't want to use the tabviews with activities inside them), so It's basically 5 activities calling each other every time the user clicks on the tabs displayed as a row of LinearLayouts at the bottom of the screen.
The thing is that the way I do it now, everytime the user jumps from one activity to another, a new activity is created and launched. Of course, I can see I'm wasting resources this way. So what I would like to do is to create every activity only once; and then if the user wants to go back to the previous (or any one that was already created and is probably paused) just check on some kind of list or array to see if the activity can be recovered and only in the case it can't; to lauch a new one.
My question is, how can I check this? should I save the intents? and how to recover the activities afterwards? I'm kind of new with java.
View 2 Replies
View Related
Jun 26, 2010
I'm trying to obtain an instance of ServiceState in my Activity. But how am i supposed to do this? There is no static method to obtain an instance or any method on any service that returns an ServiceState instance.
There is the TelephonyManager.listen() call. But i want to get the ServiceState instance when i want, not when android calls my listener because something changed.
The documentation of ServiceState can be found here: http://developer.android.com/reference/android/telephony/ServiceState.html
View 2 Replies
View Related
Jul 19, 2010
Is there any way to get the instance of a launched activity(or any view in that activity )of a application in another application.
View 1 Replies
View Related
Aug 16, 2010
We all know that hitting the back button on the device doesn't kill the application, it merely finishes (destroys) the activity running on the foreground.
Well I have come across some code which helps me capture the back button signal so that I cannot exit the application. The only way to exit it in such cases is to press the home key.
Now this situation presents me with a unique disadvantage! The inability to kill finish the application on a time of my own choosing allows the application to keep running in the background like nothing has changed.
So in such cases is the task manager my only friend or is there a way for me to otherwise kill this application?
View 2 Replies
View Related
Aug 24, 2010
I need to save some state when the user leaves my game during game play. Saving the state doesn't seem to be an issue, but I can't figure out how to restore it. The onCreate function isn't called when the Activity is resumed (only when it is first created), so I can't get my state back there. Logically, I would use onRestoreInstanceState, but it isn't being called.
CODE:..........
I see log output from onSaveInstanceState, onResume, onCreate, etc, but I never see a log message from onRestoreInstanceState and savedState is always null. Why isn't onRestoreInstanceState being called, and is there another way to get my state back?
View 1 Replies
View Related