Android :: Android Bundles Passing Pointer Or Copies Of Objects
Jul 5, 2010
If I attach an object to a bundle and store the bundle in an intent and start another activity, does that activity work on a copy of the original object or does it use the same object but just passes along a pointer?
View 1 Replies
Mar 24, 2009
was wondering about the behavior of Bundles and serializable objects. If I put a serializable object into a bundle, what is serialized then, the reference to the object or the object itself? I always assumed that the object itself would be serialized to a byte stream when calling putExtra() and re-created from that representation when calling getSerializableExtra(), but I recently stumbled upon a piece of code that put an entire view into a Bundle in thread A, retrieved it from that bundle in thread B, performed a modification on it and this modification actually became visible. This can only happen if the reference to that view was stored, not the view itself, right? Otherwise, the modification had been applied to a copy of that view and would be meaningless.
View 3 Replies
View Related
Nov 12, 2010
Is there a way to pass an Array List of objects between activities? The myObject implements Parcelable and I'm able to successfully pass the objects around individually, but that means I need to have an exact amount of "myObjects" coded. I want this to dynamically grow/shrink by what the user does with the app. I have seen some posts on the web about doing:
Activity A
ArrayList<myObject> myObjArray = new ArrayList<myObject>();
Then when passing this into the intent I would use:
intent.putParcelableArrayListExtra("myObjArray", myObjArray);
Activity B
ArrayList<myObject> myObjArray = new ArrayList<myObject>();
Bundle extras = getIntent().getExtras(); myObjArray = extras.getParcelableArray("myObjArray");
However, the myObjArray always gets filled with "null". How can I achieve this?
View 3 Replies
View Related
Oct 29, 2010
Why is that the object has to be serialized or be Parcelable in order to be passed to an Intent ?
View 1 Replies
View Related
Oct 26, 2010
The FAQ mentions a method of passing objects around activities. (It is not clear to me): "A HashMap of WeakReferences to Objects. You can also use a HashMap of WeakReferences to Objects with Long keys. When an activity wants to pass an object to another activity, it simply puts the object in the map and sends the key (which is a unique Long based on a counter or time stamp) to the recipient activity via intent extras. The recipient activity retrieves the object using this key.".................
View 7 Replies
View Related
Jun 15, 2010
I have an application that have a Google map on Google Android 1.5 since we have been working on the application for a long time, we are not in stage of upgrading to the newest framework, so we are using 1.5. Now, I have map locations that are dynamically generated and drawn on the map at run-time to visualize some streams, Up to this point the application is working fine, Now my problem is that I am trying to filter the objects ( addresses) to visualize only the on-screen ones. I do NOT want to visualize the addresses that are off-screen. The way I am trying to do this is to check the screen-coordinates of each object (address) before visualizing it, then it the coordinates (x,y) more than (0,0) and less than (320, 460). I should visualize it. I am trying to use this approach, but it is not working for some reasons, I have tried many posts but could not understand why, there must be something missing somewhere that I am not aware of.
View 11 Replies
View Related
May 22, 2010
I have been looking it up and I just cant seem to wrap myself around the onCreate and Bundles. I understand that the onCreate is called when the program starts but its how the Bundles get passed around and how they are pertinent. Can anyone try to put this into plain english because I cant seem to find it well described.
View 1 Replies
View Related
Jun 7, 2010
Lets say that I have an app that lets you browse through a listing of cars found in a Sqlite database. When you click on a car in the listing, it'll open up a view with the description of the car and a photo of the car.My question is: should I keep the photo in the database as a binary data column in the row for this specific car, or should I have the photo somewhere in the resources directory? Which is better to do? Are there any limitations of Sqlite in terms of how big a binary data column can be?The database will be pretty much be read only and bundled with the app (so the user wouldn't be inserting any cars and their photos).
View 2 Replies
View Related
Jun 19, 2009
Is there any way to pass values(strings or bundles) to another application while calling it via intents, and also return some information (mostly string)?
View 3 Replies
View Related
Apr 12, 2010
anyone buy one of these bundles on ebay for like $20? i missed out on the Droid35 vzw deal in february and now i want a dock for my car. like one of these FOR MOTOROLA DROID A855 6 ACCESSORY BUNDLE CASE+CHARGER - eBay
View 8 Replies
View Related
Jan 27, 2012
I have a little doubt, I spend data from Activity A to B with a bundle in the intent.Where I should declare the keys? In Activity A or B? Only to avoid confusion, I'm talking about the string that defines the data that will be set in the Bundle.Ex: public static final String KEY = "MyKey";
I declare always in the Activity A, but I think that if I could let all the keys in a file would be better, like keys.java or something like that.Obviously, this is nothing that is generating errors, just a doubt about convention, a thing that I consider very important in software development.
View 5 Replies
View Related
Jun 13, 2010
i just got my incredible yesterday, so i apologize if this is a bit snobbish, but I'm getting two copies of my Gmail mail on my phone, one in the mail thing and one via the gmail app. i also have an email account from my Google apps hosted email. but i cant seem to stop the gmail app from showing me the email too. how do i stop it?
View 2 Replies
View Related
May 27, 2010
Going from hero->evo means my mini usb cords are useless. I'm looking around but can't seem to find anyone selling a bundle of maybe 4-5 cords, they seem to all be selling individually along with car/wall chargers (which i won't need)
View 5 Replies
View Related
Feb 17, 2010
Does anyone know of an app to record phone calls? If not, I'm going to look into building one. I'd really like to just record all of my phone calls to have copies of them if I ever need to refer back to them.
View 24 Replies
View Related
Jan 12, 2010
With the iPhone, Apple has a system of free codes you can send to reviewers so they can install the app for free. Is there a way to do this with paid Android apps?
View 3 Replies
View Related
May 13, 2009
in Android code, It is a very strange concept to define the APN type (APN_TYPE_MMS). The reason are: 1) APN only is an access pointer, it haven't any special attribute for MMS or other things. 2) Only Application care the APN name, since different APN will provide different service from operator. for example, operation may provide Email/MMS/GPS/.... service on different APN. 3) Android only define one type APN_TYPE_MMS, this will limit other top application usage. Any one can answer me why Android design this way? If google have strong reason for such design, I hope add other user defined type like APN_TYPE_USER1 APN_TYPE_USER2 then top application can set his property to use its APN other than APN_TYPE_MMS
View 2 Replies
View Related
Jun 15, 2010
I'm working on an application where I want to add adWhirl to manage adds. The app is working fine until I tryed to use adWhirl. I have try to get the view created with setContentView(R.layout.main) by calling LinearLayout layout.
View 2 Replies
View Related
Oct 5, 2010
The line "return db.insert(DATABASE_TABLE, null, initialValues);" is returning a null pointer and I cant figure out why! I'd be grateful for any help public class Database extends Activity {
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
DBAdapter db = new DBAdapter(this);
if(db != null){
long id = db.insertUser("test", "test");
Cursor c = db.getUser(id);
Log.d("DB", c.getString(1));
Log.d("DB", c.getString(2)); db.close();.......
View 1 Replies
View Related
Mar 2, 2010
In following code, is it possible cause some memory leaks?
View 2 Replies
View Related
Sep 11, 2009
On my emulator under 'dev tools' there is an app called pointer location.Where is the source for this activity/app?
View 3 Replies
View Related
Jul 1, 2013
Is it possible to have two copies of one app so I can open one and have one account on it and open the other and have another account? (I have root)
View 3 Replies
View Related
Feb 9, 2010
My application when user accessing map i want to point his location with his image and his name it just like pointer container name and image how to make it.
View 2 Replies
View Related
May 31, 2010
I'm writing an android program in which I have an activity that uses tabs.Anybody have any idea how I can get this content into a tab without crashing my application? My actual program is more complex and has more than one tab but I simplified it down to this in an attempt to find out why it's crashing but it still crashes and I don't know why.If I don't use LayoutInflator my program doesn't crash but I don't get any content either, just tabs.
View 1 Replies
View Related
Apr 1, 2010
I'm installing the Android SDK on Mac OS X. Following the instructions on the Android Development site, I've downloaded the SDK and modified my .bash_profile to include the path. The next step is to use the Android SDK and AVD Manager to actually download the platforms.
However, when I use the Manager to install the platforms, I get the following error in the Terminal. I've looked around for similar problems in the Eclipse and Android forums and haven't found anything yet. Is something else damaged in the environment and needs to be repaired? Any recommendations on where I should look? Code...
View 2 Replies
View Related
Feb 3, 2009
Does anybody have any idea why I get often(but not always) error during the on touch event? Handling touch events is freezed for few seconds(this appears only immediately after application start). Then Error screen appears (choose wait of close). When I choose wait after few seconds screen is starting to process events. I'm using surfaceView with thread for painting. In logcat I get something like : "No window to dispatch pointer action 1".
View 2 Replies
View Related
Sep 4, 2009
I am receiving Text messages from another application sent through broadcast intent. I am displaying these messages to my application's GUI. In my application I had defined <broadcast receiver> in my manifest.xml
<receiver android:name=".HHBroadcastReceiver">
<intent-filter>
<action android:name="android.demo.test"/>
</intent-filter>
</receiver>
And also define the logic in the Broadcast receiver class
public class HHBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { //TODO: React to the Intent received.
String msg_receive = intent.getStringExtra("message1");
AssetTest.hh_text.append("
"+msg_receive); } }
View 2 Replies
View Related
Sep 28, 2010
I need to disply current Position latitude and logintude...I tried but it will show Null pointer exception.. here with i attached my code...
I run this application on android emulator
CODE:...............
View 11 Replies
View Related
Apr 23, 2010
I cant figure out why my program is showing null pointer exception. Plz help me.I have declared the getter and setter methods in a seperate claa named SongsList. Plz help me determine the problem...
View 1 Replies
View Related
Nov 21, 2010
I have a null pointer on a button that I need to take me to a new layout when pushed. I have the code set as:
((Button) findViewById(R.id.analyzee)).setOnClickListener(btnClick); inside a method that uses conditional statements. It is a basic face detect app. If faces are not found, I do this:
if (facesFound < 1) {
mFlipper.setDisplayedChild(2);
mTheMessage = (TextView) findViewById(R.id.falsemessage);
mThePicture = (ImageView) findViewById(R.id.false_view);
mTheMessage.setText(R.string.noFaceOne);
mThePicture.setImageBitmap(bitmap565);
return;
if faces are found, I draw a box on the face, and do this: Code...
So, my issue lies in this: In one of my layouts in the flipper, the button that rests on the layout will need to give the user the option to snap a new picture if there are no faces found. The other layout will need the button (upon click) to have the faces cropped and the results to be sent to another layout.
The issue I am facing is where the code: ((Button) findViewById(R.id.crop_face)).setOnClickListener(btnClick);
needs to be placed in order for the program to release the button has been clicked, it calls the case in my switch statement, and runs the crop face_method.
I try putting it in the if statement where I set the image View and text View, but I get a null pointer on that line I am declaring my button on.
The buttons I have on my main menu work fine, as they are in my onCreate method, but I don't know where to play this button command, and also where I need to place my reopen Camera command.
View 1 Replies
View Related
Sep 8, 2009
I'm trying to get a location from lat /lon values with the getFromLocation function:
adresses = geocoder.getFromLocation(lat, lon, 1); // Search addresses
The function should return a empty List, if it don't find an address, but it throws the NullPointerException. What can/must I do to fix it?
View 2 Replies
View Related