Android :: Passing Aray List To Next Activity In Widget Application

May 20, 2010

I am trying to create app widget.In this widget I have added one image button.If i click on this button i should pass list of object to next activity.Before passing this list to activity I am converting it to parceable list and adding it to bunddle and puting that bundle to intent.This logic is working fine in android 1.6, but this is not working in Android 2.1.In android 2.1.I am getting Null pointer excepion when I try to access this list in next activity.To solve this problem I tried to pass only String data through bundle,in next activity String is displaying properly,but when I try to pass list,then only i am not getting list in next activity.

Android :: passing aray list to next activity in widget application


Android :: Passing Array Buffer Between Activity In Same Application

Apr 7, 2009

I am developing an image applications.

One activity decoding image file (jpg, bmp, and so on) to byte buffer RGB 565 or 888 type.

Then want to pass image buffer to another activity for change image data.

I have 3 activity the main decoding activity[A] and selecting effect activity[B] and apply effect activity[C] for change image data.

If i use intent then activity[A] should make intent[1] and putExtra to that intent. and then [B] call getIntent and getByteArrayExtra for get byte buffer.

If user select effect then [B] make new intent[2] and putExtra to intent[2]. and startActivityForResult with intent[2] and activity[C].

Then activity[C] call getIntent to get intent[2] and getByteArrayExtra for get byte buffer again.

There takes much times to make new byte buffer and copy from parent's activity's byte buffer 2 times. [A]->[B] and [B]->[C]

That process drops application performance.

Questions

1. Can i pass intent[1] to activity[C] without make new intent[2] and putExtra byte buffer? by modify intent[1]. (if it works just 1 buffer copy will perform)

2. Can i use application global memory for share byte buffer? if i use hash map how can each activity access same hash map? (if it works don't need to copy buffer)

View 2 Replies View Related

Android :: Passing Touch Events From One Gallery Widget To Another Widget

Feb 18, 2010

I am trying to pass the same touch events on one widget to the other so they both scroll at the same time and in same way. I have two Gallery widgets one above and one below. If the above one is scrolled then I want to pass the same touch event to the bottom widget so it also scrolls the same way.I have tried to use dispatchtouchevent events but I am facing an issue where in if the bottom gallery widget has some edit text then the edit text gets the key event and both widgets doesnt scroll anymore.I have tried to set focussable and editable to false on edittext even then it gets the touch events.I think I am going in the right direction. However I need some assistance in doing the right way.

View 3 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 :: List Activity In Application?

Sep 2, 2010

I have a list activity in my application. i have tried to make it so that when a list item is selected to show the selection the background of the view should change. but now when i select one item, the item does get selected but the back ground of random listitems changes at the same time, but the selection is still correct
CODE:...........................

View 1 Replies View Related

Android :: Display List In Homescreen Application Widget?

Oct 13, 2009

I can't find how to display a list in the app widget. I have created one app-widget which fetches the database table information and I want to display all the icon:text into app-widget. Remoteviews doesn't have any list functionality.

View 2 Replies View Related

Android :: Notify Application When Item Is Selected In List Activity

May 3, 2009

I need some help using ListActivity. The API provides "onListItemClick" which you can override and is called when user selects an item in the list.

However I want the same type of functionality when an item in the list is selected. So as soon as user highlights something in the list I want my application to do something (like play a preview). I dont want to wait for user to select the button.

View 2 Replies View Related

Android :: Passing Integer From Android Home Screen Widget To An Activity Opened By The Android Home Screen

Jun 12, 2010

How can we pass Android Home Screen Widget info ( putExtra maybe ) to an Activity.. What particular method callback will handle this one?

View 1 Replies View Related

Android :: Clock - Which Is In The Destop - Widget Or Application - Activity?

Apr 22, 2009

I have a question for widget support on Android. I found clock in the android destop, and want to know if it is a widget or application (Activity)? If it is a widget, what about the widget engine (runing enviroment) of android?

View 4 Replies View Related

Android :: Passing Values From One Activity To Another

Feb 11, 2010

I have an app which makes use of several layout-views. Every layout - view also got a class for it, which extend the Activity class. One class for example retrieves some database values whilst offering a search form to the user. Afterwards the user can select one of those values and he gets presented with another screen which gives similar options as the one selected. Anyways, I'd like for the first Activity to be able to send an array with data (Strings for example) to the second one. Right now I show an activity by using:

Intent i = new Intent(this, activitysName.class); startActivity(i);

I have no idea whilst using this construction how I can "initialize" the new object with the String array I want to pass to it. So how should this be achieved ? Should I be using something else instead of an Intent-Activity combination ?

View 5 Replies View Related

Android :: Passing Bitmap To Another Activity

Jun 7, 2010

I have a Bitmap image and i want to forward the bitmap to another activity. I have two activities Activity A and Activity B. This is how I started the Activity B
startActivityForResult(new Intent(Activity A.this, Activity B.class), 120);
in activity B
private void forwardImage(Bitmap bit) {
Intent i = new Intent(MMS.this, Compose.class);
i.putExtra("MMS", bit);
setResult(RESULT_OK, i);
finish(); }

This is not forwarding to Activity A but if I put a String to the intent it'll forward. This is how I listen to result in Activity A

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
// super.onActivityResult(requestCode, resultCode, data);
switch (resultCode)
case RESULT_OK: Intent intent = getIntent();
Bitmap bitmap = (Bitmap) intent.getParcelableExtra("MMS");
mmsImage.setImageBitmap(bitmap);
default: break;
} }

How can I pass a bitmap.

View 3 Replies View Related

Android :: Passing Parameters To New Activity

Mar 2, 2009

I'm programming an Activity that launches a second one through startActivity just like in the Forwarding example. The main difference is that I'd like to pass some data to the second Activity when starting it, for example an item selected in a list owned by the first Activity. I can't find how to do that. Am I missing something? I guess I do.

View 3 Replies View Related

Android :: Passing Value From ListView To A New Activity?

Jun 14, 2010

I have a ListView that shows a list of names. When you select a name, I want to pass the selected person' ID to the next view (Profile) and retreieve their data based on their ID. I am able to load the Profile View, but do not know how to pass the ID from the ListView to the Profile. Here is how I am loading the Profile: Code...

View 2 Replies View Related

Android :: Widget Can Sync With Google Calender Or Todo List Application For Igoogle Homepage

Dec 12, 2009

Is there a 'to do list' widget that can sync with Google calender or the todo list application for igoogle homepage?

View 3 Replies View Related

Android :: Passing Values From Activity To Another File

Nov 20, 2010

I have a need where I must pass some values from an Activity to another file which extends View class (instead of Activity). Its not the normal passing of values from one activity to another. In my Activity, I will pass some co-ordinate values to the class that extends View. In this class, I will draw an image and place points over the image on the required co-ordinates. But, the problem is, I cant send values using Intent.

View 11 Replies View Related

Android :: Passing Linear Layout From One Activity To Another

Feb 28, 2010

For a rather crazy reason I am trying to pass a linear Layout from one activity to another. Should I use an intent extra for this? What would be the right way to create a Linear Layout in one activity and then spawn a new activity using that linear Layout.

View 8 Replies View Related

Android :: Passing A 2 Dimensional Array To An Activity

Apr 1, 2009

I need to pass a 2 dimensional array to an ACTIVITY from a SERVICE. How can I achieve this in minimum number of statements (as in avoiding putExtras for each and every string stored in the array)?

View 4 Replies View Related

Android :: Passing Data Between Service And Activity

Sep 19, 2010

So I'm getting really confused on how to do this whole thing and I was hoping someone could break it down for me a little bit.I have a service that should always be running, and at certain times it needs to alert the user that a task is to be completed(probably through a notification bar icon). When the user accepts the task, the service needs to look into the local database, construct some non primitive objects, and give them to the activity that it just started.I have looked all over and gotten very confused as to a proper approach so I have a few questions to help me wrap my head around it.If an activity creates a local SQLite database can the service and activities of that application access that same database later?Does the service and activity need to be in the same or separate packages? I would think no but for some reason I remember seeing something about this elsewhere.

How would I do the data transmission from the service to the activity? I was thinking a content provider but it seems like there should be an easier way for the service to just hand off the data. Similar to an Intent but for non primitives.

View 2 Replies View Related

Android :: Passing Keyevents To The Next Activity In The Stack

Apr 4, 2009

I'm trying to create an activity which would be on top of other activities (a small dialog themed activity) and I want to get ALL key events to be ignored by my activity and handled normally by the activity beneath it. When I say all I mean the send, end and back keys too. Is this possible?I've tried setFocusable(false), setting the flag FLAG_NOT_FOCUSABLE, and adding a dummy onKeyListener but nothing doesn't seem to do the trick.

View 4 Replies View Related

Android :: Passing Array By Calling Activity From A Thread

Jul 23, 2010

I have two activities:

"a" that spawns thread for generating a dynamic array of values inside public void run() function.
"b", graphics activity that will help me draw rectangular pulses based on array values calculated in activity "a" (calculated in a's thread to be precise).

When I am in thread inside "a", how do I pass values of array to activity "b" and
call activity as well.

activity A

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

activity B

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

View 1 Replies View Related

Android :: Passing Information Back From EventListener To Activity

Nov 6, 2010

I'm new to Android, and event driven code in general. Rather than embed loads of anonymous event listener classes in my Activity to handle onClick events etc, I defined separate classes to keep the code clean. Then I use them e.g. like this

myButton.setOnClickListener(new MyEventListener());

So, when 'myButton' gets clicked, MyEventListener's onClick method does some stuff.

I wanted to know the best practice for

a) accessing things in my Activity from the event listener. For example to change the text of a label. The onClick event takes a View in, but this is the view for the button that's been clicked, so if the label is NOT a child of my button, I can't use findViewById to get a handle to it. I've modified the constructor to pass in a reference to the label, so that the event has a handle to it but not sure if this is the most elegant way of doing it.

b) Passing information back e.g. when my event fires, I might want to disable some EditText fields. I'm thinking the proper way to do this is probably to dispatch another event from my event listener, that the Activity listens for, and when it sees the event, disables the fields in question. Is that the way to do it in Android?

View 1 Replies View Related

Android :: Passing Intents From Service To New Launch From Main Activity

Mar 30, 2009

How do you pass an intent from a service to a new activity launched from a main activity? There's a passextra( intent src ); but I don't think thats what I am looking for?

activity main > start service( intent wuteverserviceintent );
activity main > start activity( intent newactivityintent );

View 2 Replies View Related

Android :: Force Browser Activity To Close After Passing Control

Sep 21, 2009

So I read through the SDK docs and I thought that calling a new activity(browser) as part of a task (myTask) will mean that activity* (browser) will close when a user closes the task (myTask) But I am left with a browser window.

Here is my scenario (in sudo code);

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

Question 1: What is the cleanest way to ensure that when a user closes my app, any outside activities called will be closed to.

Question 2: Does a callback URl start a new Task, or use one in the stack if available?

View 3 Replies View Related

Android :: Display A Dialog In Non-Activity - Simple Java - Class By Passing Parameters

Jun 23, 2010

I am trying to display a dialog box in a simple Java class that is called from my main Activity but not successful. Please help me to figure it out.

I am passing the required values as parametrs.

I have two class: class MainActivity extends Activity :: Main *starting point *of Application class ShowMyDialog :: a simple java program In which I *generate an URl* and *display a dialog with WebView*.

I am passing the Acitivity from my MainActivity to this class as a parameter in function.

But I am *unable to call* the onCreateDialog method that I have *defined in the simple java class.

However, If I define the *onCreateDialog method in MainActivity, I am able to display it successfully.

What Should I pass as Parameter to the non Activity class from MainActivity class so that I am able to display the dialog as defined by showdialog method in JAVA class ???*

My steps of source code is as follow:

code:.........................

View 3 Replies View Related

Android :: Way To Present List To User Where Each Item On List Starts An Activity When Selected

Nov 4, 2010

I am on my first Android application and I am on a timeline so details and examples will be useful since my knowledge is still minimal. I want my first screen to present the user with a list of activities to choose from. In my situation it is a recipe app where the user first chooses the type of food, such as, Beef, Chicken, or Pork. I want the application to launch an activity depending on the list item that the user clicked on. I am not sure if I should use a list view, a text view, a scroll view, a list activity, an activity group...

View 1 Replies View Related

Android :: Orientation Change Crash In Tab Activity With List Activity

Jan 21, 2010

When views with different type have same id and screen orientation changes,

either java.lang.ClassCastException: android.view.AbsSavedState$1 or java.lang.IllegalArgumentException: Wrong state class -- expecting View State will occur. (depends on the view's order)

Because View.dispatchRestoreInstanceState() checks id only.

You may wonder why anyone would make views with different type to have same id.

But it can happen when you use tab activity.

Imagine you have tab activity with two children activity.

Tab1 is ListActivity and Tab2 is ExpandableListActivity.

Both activity have id of "@android:id/list" but the type of view is different.

This means we cannot use ListActivity & ExpandableListActivit at the same in one tab activity.

View 4 Replies View Related

Android :: Can Update A List View In One Activity While Im In Another Activity

Oct 4, 2010

I currently have a tab layout with 2 tabs, one tab with a list view and one with the option make strings so I can add them in the list view. Both tabs have their own activity because this made the code much more structured, and I dont have to repeat my self later.

Lets say im in the tab that offer me to create an string, and i press the update list button, how do I update the list view without startActivity()? If i use startActivity(), it starts List.java, and instead of displaying the list in the list view tab, it takes full screen, which defies the purpose of the tab view. In other words, the startActivity() steals the focus from the tab view of the list, and sends it fulscreen.

I want to update the activity in my list view tab, without starting a new activity that goes to fullscreen, and doesnt update the one in the tab.

View 2 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 :: Design Clarification In Android List Activity Vs Activity

Mar 25, 2010

I have a simple question. I am trying to design a simple Android app, which based on keywords searches something and shows a listing view of results. Currently it merely searches SMSes in the cellphone.Here are some of the things I am faced with: I have a simple first page with a textbox and a submit button. It's rendered by "Activity" inherited class call SMS Finder.once I have the results present with me, I want them to be binded to a list view. Showing preview text to limited characters, say 20 chars. Clicking on the same should "ideally" open the inbox (or outbox or whatever) and open the SMS, however that meant I cannot come back to my app easily. So I would rather open the whole SMS in my own app. So clicking on the app should open the SMS in a new screen with complete message, sender info etc. Few questions here, For generic Android phone apps, what are the best practices to make UI as compliant to as many phones? Like what kind of views should I use?

View 1 Replies View Related

Android :: Remove Application From Recent Application List

Sep 21, 2010

I guess that Android won't let people to do this, because they think they have perfect handle for the task/applications. However, I really need to do this in my case.

I have an activity A acting as the entry point of my application. In that activity, it reads the preference and decided which activity to start, say B or C. After that, it finishes itself. So, activity A never appears to the users.

My application stores things on sdcard, and reads from it constantly. So, when the sdcard is unmounted, I need to display a message to the user that the sdcard is unavailable, instead of opening B or C. I set a check in A to display that message when sdcard is unavilable. When that message is displayed, A will not try to start B or C.

Things works perfectly if user only enter my application from application launcher. However, I found that user can also enter my application by long pressing home and choose it from the recent application list, if he has opened it recently. When user does that, it skips A and goes directly to B or C. I don't have the check in both of them, so exception is thrown while I am trying to access sdcard, and force close dialog pops up.

I can simply move my check to both B and C to fix this problem. But in the future, the number of activities started from A will increase. If there are 6 of them, I'll need to copy this check to 6 places. Needless to say, this looks very ugly, and is a maintenance nightmare.

So, the best fix should be removing my application from recent application list when the sdcard is uunmounted. However, I can't find how to do this. Even killing the process or use ActivityManager.restartPackage, it still appears in the list. Can anyone tell me how to remove it from the list?

View 2 Replies View Related







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