Android :: Pass In Bitmap As EXTRA_STREAM Parameter When Launching An Intent?

Jun 25, 2009

From the JavaDoc, the EXTRA_STREAM parameter when launching an intent needs to be an URI. How can I pass a Bitmap object which I get from launching a "android.provider.MediaStore.ACTION_IMAGE_CAPTURE" intent? code...

Android :: Pass in Bitmap as EXTRA_STREAM parameter when launching an Intent?


Android :: Pass Parameter To A Webservice Using Ksoap2

Jan 21, 2010

I'm using eclipse to develop over android, i'm trying to connect to a .net webservice...when i'm calling a webmethod with no parameters it works fine... but when i come to pass a parameter to the webmethod things turn upside down... the parameter is passed as null (while debugging the webservice i discovered that) and i get a null from the webmethod in the client side code... i've been searching for a solution for a day now and all that i can interpreter is that people keep talking about encoding styles and such stuff.... i've tried it all but in vain. i'm using ksoap2 version 2.3 with the following code:

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

View 4 Replies View Related

Android :: Pass Parameter To New Activity With Tab Host?

Oct 15, 2010

I am passing parameter to new activity using tab host in android but it showing illegal exception code...

can anybody tell how to pass parameter using intent with tabhost in android

View 1 Replies View Related

Android :: How To Pass Drawable As Parameter So Images Get Parsed?

Jul 22, 2010

I try to save a unique image to each object but I get this error, how should the constructor look for it to work that way? The constructor Beer(String, int, int) is undefined

m_beer = new ArrayList<Beer>();
final Beer b1 = new Beer("Tuborg", 7, R.drawable.tuborg);
final Beer b2 = new Beer("Carlsberg", 7, R.drawable.carlsberg);
final Beer b3 = new Beer("Urquel", 9, R.drawable.urquel);
public class Beer { //Members private String name;
private int color; //1 = Very dark 10 = Very light private R.drawable icon;
//Methods public Beer(String name, int color, R.drawable icon) {
this.name = name; this.color = color; this.icon = icon;
} public String getName() { return name;
} public void setName(String name) { this.name = name;
} public int getColor() { return this.color;
} public void setColor(int color) { this.color = color;
} public R.drawable getIcon() { return icon;
} }

View 2 Replies View Related

Android :: Pass A Class Reference As Parameter To An Activity?

Mar 9, 2009

I want to pass a class reference to an activity, and then the activity will construct the view according to the content of the class.

How could I implement this function?

View 3 Replies View Related

Android :: Can I Pass A Parameter When Launch Other Apps From Mine

May 14, 2010

How to pass a parameter to an application that I call from my Application?

View 1 Replies View Related

Android :: Pass In Object Java Class Embedded In As Parameter

Apr 19, 2010

I'm building an android application, which has a list view, and in the list view, a click listener, containing an onItemClick method. So I have something like this:

public class myList extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
getListView().setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
/* Do something*/
}
}
}

Normally, this works fine. However, many times I find myself needing too preform an application using the outer class as a context. thusfar, I've used: parent.getContext(); to do this, but I would like to know, is that a bad idea? I can't really call: because it's not really a subclass, just an embedded one. So is there any better way, or is that considered cosure? Also, if it is the right way, what should I do if the embedded method doesn't have a parameter to get the outside class?

View 2 Replies View Related

Android :: Attach A Bitmap When Launching ACTION_SEND Intend?

Jun 25, 2009

I have this code: Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); startActivity(intent);

which successfully launch an Messaging App on android.

But how can i attach a Bitmap object when launching the intent?

I have read http://developer.android.com/reference/android/content/Intent.html, the closet thing to what i need is EXTRA_STREAM, like this: intent2.putExtra(Intent.EXTRA_STREAM, _uri);

but my case, I have a reference of Bitmap object, not an URI of an Bitmap.

Please tell me what can I do to attach a Bitmap object?

View 3 Replies View Related

Android :: How To Pass A Bitmap Object From 1 Activity To Another

Mar 17, 2010

In my activity , I create a Bitmap object, and I need to launch another activity,
How can I pass this Bitmap object from the sub-activity (the one which is going to be launched)?

View 1 Replies View Related

Android :: Launching My App Using Intent URI

Aug 25, 2010

I know this has been asked a lot of times in StackOverflow already, but I haven't quite found a solution yet. My app sends an email with a link in it that when clicked should launch the app. According to @hackbod, the best way to do it is to make use of the Intent URI (see this). Here's my code that sets the intent and puts it in the email body: Code...

View 1 Replies View Related

Android :: Launching M3u Playlist With Intent?

Aug 16, 2009

Is there a way to launch a playlist whith intent? I can retrieve the path of the m3u playlist with: Cursor cursor = context.getContentResolver().query (MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null, null); cursor.getString(cursor.getColumnIndex (MediaStore.Audio.Playlists.DATA)); But, I can't launch this m3u file neither with Intent nor with MediaPlayer.

View 5 Replies View Related

Android :: Launching Intent Can't Find Activity

Jul 2, 2010

My program has a list of tabs that each contain a list of people.Clicking a person should edit their details, but instead, clicking a person throws an ActivityNotFoundException.

View 2 Replies View Related

Android :: Launching Intent From Class Outside An Activity

Jul 28, 2010

I've got two activities, one of them is called MyActivity. I want both of them to be able to use a function located in a class othat we may call MyClass. In MyClass, I try to use an intent to launch the activity AnotherActivity. Since the constructor takes a context as parameter, I simply tried to store a context from the activity in the constructor, and then use it when I try to create my intent.However, even thought none of the arguments are null (checked that with a simple if-statement), intent seems to be null and a NullPointerException is thrown. Why does it not work, and what can I do to solve the problem?
I'm quite new to Android and Java development, so please explain it as basic as you can.

View 2 Replies View Related

Android :: Launching Google Maps Directions Via Intent

Apr 18, 2010

My app needs to show Google Maps directions from A to B, but I don't want to put the Google Maps into my application - instead, I want to launch it using an Intent. Is this possible? If yes, how?

View 2 Replies View Related

Android :: App Crashing On HTC Magic Launching Camera Intent

Jul 15, 2009

Wine by the Bar app (free in Android Market) is crashing on the HTC Magic.What intent settings/extras are needed to successfully launch ACTION_IMAGE_CAPTURE on HTC Magic?intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);App works fine on G1.Also need proper intent for choosing an picture already on the phone, and a cropping intent.

View 4 Replies View Related

Android : Can I Pass Value Through Intent?

Aug 11, 2010

But the problem is i am getting a blank view.My view is not coming up with textview. is this proper to set background "DetailsTextView.setBackgroundResource"?

View 1 Replies View Related

Android :: Launching Intent Not Working On Saved Image File

Jun 2, 2010

First of all let me say that this questions is slightly connected to another question by me. Actually it was created because of that. I have the following code to write a bitmap downloaded from the net to a file in the sd card:

// Get image from url
URL u = new URL(url);
HttpGet httpRequest = new HttpGet(u.toURI());
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
HttpEntity entity = response.getEntity();
BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
InputStream instream = bufHttpEntity.getContent();
Bitmap bmImg = BitmapFactory.decodeStream(instream);
instream.close();

// Write image to a file in sd card
File posterFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Android/data/com.myapp/files/image.jpg");
posterFile.createNewFile();
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(posterFile));
Bitmap mutable = Bitmap.createScaledBitmap(bmImg,bmImg.getWidth(),bmImg.getHeight(),true);
mutable.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.flush();
out.close();

// Launch default viewer for the file
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(posterFile.getAbsolutePath()),"image/*");
((Activity) getContext()).startActivity(intent);

A few notes. I am creating the "mutable" bitmap after seeing someone using it and it seems to work better than without it. And I am using the parse method on the Uri class and not the fromFile because in my code I am calling these in different places and when I am creating the intent I have a string path instead of a file. Now for my problem. The file gets created. The intent launches a dialog asking me to select a viewer. I have 3 viewers installed. The Astro image viewer, the default media gallery (I have a milstone on 2.1 but on the milestone the 2.1 update did not include the 3d gallery so it's the old one) and the 3d gallery from the nexus one (I found the apk in the wild). Now when I launch the 3 viewers the following happen:

Astro image viewer: The activity launches but I see nothing but a black screen.
Media Gallery: I get an exception dialog shown "The application MediaGallery (process com.motorola.gallery) has stoppedunexpectedly. Please try again" with a force close option.
3D gallery: Everything works as it should.

When I try to simply open the file using the Astro file manager (browse to it and simply click) I get the same option dialog but this time things are different:
Astro image viewer: Everything works as it should.
Media Gallery: Everything works as it should.
3D gallery: The activity launches but I see nothing but a black screen.

As you can see everything is a complete mess. I have no idea why this happens but it happens like this every single time. It's not a random bug. Am I missing something when I am creating the intent? Or when I am creating the image file? As noted in the comment here is the part of interest in adb logcat. Also I should note that I changed the way I create the image file. Since I want to create a file that reflects an online file I simply download it instead of creating a Bitmap and then creating the file (this was done because at some point I needed the Bitmap but now I do it the other way around). The problems persist thought and are exactly the same:

I/ActivityManager(18852): Starting
activity: Intent {
act=android.intent.action.VIEW
dat=/sdcard/Android/data/com.myapp/files/image.jpg
typ=image/* flg=0x3800000
cmp=com.motorola.gallery/.ViewImage }
I/ActivityManager(18852): Start proc
com.motorola.gallery:ViewImage for
activity
com.motorola.gallery/.ViewImage:
pid=29187 uid=10017 gids={3003, 1015}
I/dalvikvm(29187): Debugger thread not
active, ignoring DDM send
(t=0x41504e4d l=38)
I/dalvikvm(29187): Debugger thread not
active, ignoring DDM send
(t=0x41504e4d l=64)
I/ActivityManager(18852): Process
com.handcent.nextsms (pid 29174) has died.
I/ViewImage(29187): In View Image
onCreate!
D/AndroidRuntime(29187): Shutting down VM
W/dalvikvm(29187): threadid=3: thread
exiting with uncaught exception
(group=0x4001b170)
E/AndroidRuntime(29187): Uncaught
handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(29187):
java.lang.RuntimeException: Unable to
start activity
ComponentInfo{com.motorola.gallery/com.motorola.gallery.ViewImage}:
java.lang.NullPointerException
E/AndroidRuntime(29187): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
E/AndroidRuntime(29187): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
E/AndroidRuntime(29187): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
E/AndroidRuntime(29187): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime(29187): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29187): at
android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(29187): at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime(29187): at
java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(29187): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(29187): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(29187): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime(29187): at
dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(29187): Caused by:
java.lang.NullPointerException
E/AndroidRuntime(29187): at
com.motorola.gallery.ImageManager.allImages(ImageManager.java:5621)
E/AndroidRuntime(29187): at
com.motorola.gallery.ImageManager.getSingleImageListByUri(ImageManager.java:5515)
E/AndroidRuntime(29187): at
com.motorola.gallery.ViewImage.onCreate(ViewImage.java:1801)
E/AndroidRuntime(29187): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(29187): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
E/AndroidRuntime(29187): ... 11 more

View 3 Replies View Related

Android :: Pass Image To New Intent

Nov 19, 2009

I've got a problem My app show a first layout like: Gridview1 (3 images in 1 row) ImageView1 (1 image) Gridview2 (3 images in 1 row) ImgaeView2 (1 image) Gridview3 (3 images in 1 row) ImgaeView3 (1 image) When you clik over an image it will be open full screen in a second layout, The problem was that I don't know how to pass the image to the new intent. Now I've the next code:

public AdapterView.OnItemClickListener pulsarImagen = new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) { Intent intent = new Intent(GridViewer.this , GalleryViewer.class); intent.putExtra("id", arg0.getItemIdAtPosition (arg2)); startActivity(intent); //finish(); } };

But the ItemID is always 0. Before I've only one gridview and then I passed the item's position. But now I've 3 different gridviews and I don't know if the position of item selecte it's from gridview 1,2 or 3. I supose that the great solutin it will be to pass the id resource (image) but I don't know how to pass it. Can you help me?

View 4 Replies View Related

Android : Way To Pass Object In Intent

Jun 25, 2009

Is it possible to pass an object to the intent so i can access that object in my new activity?

View 2 Replies View Related

Android : Pass An Intent From One Device To Another?

Oct 15, 2010

I would like to know if it is possible to pass a certain intent from one device to another? For example, device A is viewing a certain webpage, then I want that link to be sent to device B, and automatically launch that intent to device B. But without using the C2DM feature.

View 10 Replies View Related

Android :: Pausing VideoView When Launching A New Intent / Resume It To Starts Up Activity Again?

Jul 23, 2009

I have an activity that is showing a video and when the user clicks a button, a new activity is launched. When the video activity stops, I pause the video view. When the video activity starts up again, I try to resume the video view videoView.start(), however, the video starts over from the beginning. I'm thinking that the buffer must be lost somewhere, so I now try to capture the current position via videoView.getCurrentPosition(), however, this is always returning 0.

Anybody know how to resume video playback when an activity starts up again?

View 5 Replies View Related

Android :: How To Pass SortedSet As Intent's Extra?

Jun 28, 2010

I have a service that produces as result a SortedSet object. I need to pass it to another Intent that will use it. First is put in the notification area, then when the user actions it it will need to fire the activity.As it it's own SortedSet is not Parcelable nor Serializable so it won't work. One single item in SortedSet is already parcelable and it's used fine, but I need the whole set.How to pass a SortedSet as an Intent's extra?

View 1 Replies View Related

How To Pass More Than One Value Through Intent

Dec 2, 2013

The below passes in an extra message to a class called DisplayMessageActivity

[HIGH]
/** Called when the user clicks the Send button */
public void sendmessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message); // here extra value
startActivity(intent);
}
[/HIGH]

How can i pass in another value because at the other end i can only get Extra_message which can only be used once....

this is inside the DisplayMessageActivity
[HIGH]
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
[/HIGH]

How to pass two values

View 3 Replies View Related

Android :: Pass Data From Activity To Service Using An Intent

Jul 20, 2010

How do I get data within an Android Service that was passed from an invoking Activity?

View 1 Replies View Related

Android :: Can We Pass Singleton Class's Object Via Intent?

Sep 3, 2010

Can I pass a singleton class's object from one activity to another activity using intent? I am using singleton class as image class img = image class.get Instance();, so i need the img instance for another activity, how can i pass an object instance in Android.

View 2 Replies View Related

Android :: How To Pass An Object To An Activity Via Intent.putExtra?

Aug 7, 2009

I am developing an app that connects to a server. For that connection I created a class Client that maintains info about the connection . My app consists of several Activities and each of that Activity needs access to the Client object to communicate to the server. 1) Can I put somewhere the Client object so that all Acitvities have an access to it? 2) If not I would probably need to pass the object to each Activity via Intent.putExtra(). But putExtra doesn't accept Object as an argument. It only accepts several types like int, long, String etc. So how can I pass an object to another Activity?

View 2 Replies View Related

Android :: Pass Intent Via StartActivity() To A Running Activity

Aug 10, 2010

MyService and MyClient are both running, although MyClient is currently in the background. If MyService sends an Intent to MyClient via:

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

How do I get this Intent in MyClient? Running this code triggers onResume() in MyClient, but because it's already running, calling getIntent() returns the Intent that initially created MyClient, which is always android.intent.action.MAIN

View 2 Replies View Related

Android :: Pass Cookie To Browser Via Intent / Need More Code

Sep 15, 2010

I have saved a cookie in android. Now I want to pass it into my browser intent. Look at my current code:

Intent browser = new Intent("android.intent.action.VIEW",
Uri.parse("http://mypage.php/memberpagethatrequireacookie.php"));
//putExtra cannot take these arguments -> browser.putExtra("org.apache.http.cookie.Cookie", cookie);
startActivity(browser);

I want it to store temporarily in my browser so my member page loads successfully.
My cookie are successfully created from the HTTP request and I assign it to a List<Cookie> cookie;
Tell me if I should provide some more code.

View 1 Replies View Related

Android :: Pass Enumerators To An Activity Constructor From An Intent?

May 14, 2010

I have an activity that when started needs access to two different ArrayLists. Both Lists are different Objects I have created myself.

Basically I need a way to pass these objects to the activity from an Intent. I can use addExtras() but this requires a Parceable compatible class. I could make my classes to be passed serializable but as I understand this slows down the program.

What are my options?

Can I pass an Enum?

As an an aside: is there a way to pass parameters to an Activity Constructor from an Intent?

View 3 Replies View Related

Android :: JNI CALL Change Jclass Parameter Or Obtain Jobject From Jclass Parameter?

Nov 19, 2010

I'm testing some functions with Android, JNI and NDK. I have the following JAVA class:

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class JNITest extends Activity {
private int contador;
/** Called when the activity is first created. */...........................

View 1 Replies View Related







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