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?

Android :: Pausing VideoView when launching a new intent / Resume it to starts up activity again?


Android :: Launching Correct Activity On Resume

Jan 22, 2010

I'm currently working with a two-activity application. The first activity allows the user to choose options for their upload, and the second activity displays a ListView of their results once processed.I have code in place that performs the uploads/downloads in the background, regardless of whether the application is currently in focus or not (thanks to Matthias Kaeppler's Droid-Fu).I would like to have my application Resume into my second (results) activity when a user clicks on the icon from the top-level launcher, regardless of how long they have been away from the app. I thought that the 'alwaysRetainTaskState' flag in the Manifest would do it, but I've not had success with that. Can anyone tell me how I need to set up my Manifest to get this functionality?

View 19 Replies View Related

Android :: StartActivity -intent - And Resume To Main Activity

Jul 2, 2010

I've got an app that creates an intent for the last.fm android app in which it will start the "recommended" station for my account when i press a button. The trick i'm trying to figure out is how do i get the phone back to my app without the user having to navigate back manually? Once it start the last.fm intent it takes you to the playlist and i need it to resume back to my app automatically.

View 2 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 :: Handle Existing Instance Root Activity Launching Root Activity From Intent Filter

Apr 3, 2010

I'm having difficulties handling multiple instances of my root (main) activity for my application. My app in question has an intent filter in place to launch my application when opening an email attatchment from the "Email" app. My problem is if I launch my application first through the the android applications screen and then launch my application via opening the Email attachment it creates two instances of my root activity. steps: Launch root activity A, press home Open email attachment, intent filter triggers launches root activity A Is it possible when opening the Email attachment that when the OS tries to launch my application it detects there is already an instance of it running and use that or remove/clear that instance?

View 1 Replies View Related

Android :: How To Make Notification Intent Resume Rather Than Making New One?

Jul 22, 2010

What I have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again from any screen they want by pulling down the drop down menu and selecting it. Then when they want they can just close the notification by hitting the menu button and hitting exit and then the notification clears. This all works fine. However, when the notification is pressed it starts a new instance of the activity. What would I have to change to make it see if the activity has not already been destroyed and I can just call that instance back(resume it) and therefore not needing to load it again and won't need to add another activity to my stack.

package com.my.app;
import com.flurry.android.FlurryAgent;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.webkit.CookieSyncManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

public class Chat extends Activity {
private ProgressDialog progressBar;
public WebView webview;
private static final String TAG = "Main";
private NotificationManager mNotificationManager;
private int SIMPLE_NOTFICATION_ID;
@Override
public void onStart()
{ super.onStart();
CookieSyncManager.getInstance().sync();
FlurryAgent.onStartSession(this, "H9QGMRC46IPXB43GYWU1");
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.chat);
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.chat_notification,"ChatStarted",System.currentTimeMillis());
notifyDetails.flags |= Notification.FLAG_ONGOING_EVENT;
Context context = getApplicationContext();
CharSequence contentTitle = "Chat";
CharSequence contentText = "Press to return to chat";
Intent notifyIntent = new Intent(context, Chat.class);
PendingIntent intent = PendingIntent.getActivity(Chat.this, 0;
notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
webview = (WebView) findViewById(R.id.webviewchat);
webview.setWebViewClient(new chatClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
webview.loadUrl("http://google.com");
progressBar = ProgressDialog.show(Chat.this, "", "Loading Chat...");
}
private class chatClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i(TAG, "Processing webview url click...");
view.loadUrl(url);
return true;
} public void onPageFinished(WebView view, String url) {
Log.i(TAG, "Finished loading URL: " +url);
if (progressBar.isShowing()) {
progressBar.dismiss();
} } }
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
webview.goBack();
return true;
} return super.onKeyDown(keyCode, event);
} @Override
public boolean onCreateOptionsMenu (Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.chatmenu, menu);
return true;
} @Override
public boolean onOptionsItemSelected (MenuItem item) {
switch (item.getItemId()) {
case R.id.home:
Intent a = new Intent(this, Home.class);
startActivity(a);
return true;
case R.id.closechat: mNotificationManager.cancel(SIMPLE_NOTFICATION_ID);Intent v = new Intent(this, Home.class);
startActivity(v);
return true;
} return false;
} public void onStop() { super.onStop();
CookieSyncManager.getInstance().sync();
FlurryAgent.onEndSession(this);
} } @Commonsware

Just to be sure I have it correct, is this what you were suggesting? I was a little worried about this line:
PendingIntent.getActivity(Chat.this, 0, notifyIntent, SIMPLE_NOTFICATION_ID);
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.chat);
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.chat_notification,"ChatStarted",System.currentTimeMillis());
notifyDetails.flags |= Notification.FLAG_ONGOING_EVENT;
Context context = getApplicationContext();
CharSequence contentTitle = "Chat";
CharSequence contentText = "Press to return to chat";
Intent notifyIntent = new Intent(context, Chat.class);
PendingIntent intent =
PendingIntent.getActivity(Chat.this, 0, notifyIntent, SIMPLE_NOTFICATION_ID);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
notifyIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
webview = (WebView) findViewById(R.id.webviewchat);
webview.setWebViewClient(new chatClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
webview.loadUrl("http://google.com");
progressBar = ProgressDialog.show(Chat.this, "", "Loading Chat...");
}

View 1 Replies View Related

Motorola Droid :: GPS Starts Up When Launching Web Browser?

Jan 15, 2010

Anyone know why, when I launch the browser (the droid is not rooted or modified in anyway) I get the GPS icon in my notification bar? Then sometimes it will not do this or the icon will go away after a minute or so.

View 6 Replies View Related

Android :: Pausing Main Game Thread Until Activity Started

Aug 13, 2010

In my game when the user completes a stage, I want the main game thread to pause/sleep/wait and a new activity to be launched called StageClear that displays information about points scored etc. After this has been displayed and the user has pressed continue I want the original game thread to resume where it left off. I have tried to implement this but have so far been unsuccessful, probably because I'm new to dealing with multiple threads and also the idea of synchronizing them. I most recently tried to implement a shared package-visible object that could notify after wait was called on itself, but I am getting errors in eclipse so it won't even compile, I think because though the object is declared public in an inner class, it cannot be seen or recognised by my activity elsewhere in a file in the package. I have already built both activities but my issue is getting the main game one to launch the other, and pause whilst it waits for this activity to finish, before the main game thread continues execution.

View 1 Replies View Related

Android :: Pausing A Thread - Activity Pause Timeout For HistoryRecord

Jun 30, 2010

I'm trying to write a game engine in Android, but I don't have much familiarity with threads.

My thread has an attribute, mSurfaceHolder, which holds the surface that I'll be drawing to. The run() method for my thread looks like this:

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

STATE_RUNNING represents the state when the activity is in the foreground and the game should be running.
STATE_PAUSED represents the state when another activity has come into the foreground. I'm not completely sure why I need to still draw while it's paused, but that's what I seem to have gathered from the LunarLander example.

What I'm hoping is that while I'm looking at the activity, the game will update and draw (which I test by using LogCat). And then when I go back to the home screen or another activity appears over the top, it will just draw.

Well it does draw and update while I'm watching the activity, so the game loop itself works. But when I leave the activity, it has no effect. Here is the thread's pause() method that is called from the activity's onPause():

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

As you can see, to test this method I have logged some messages. Now what I find when I leave the activity is that "Here" is logged, but "There" is not. Now with my limited knowledge of threads (I hardly know what synchronized actually does), I believe this will happen because my thread can't get synchronized with the surface holder. But I don't know WHY it doesn't synchronize. A few seconds after I've left the activity, I see the following warning in LogCat:

Activity pause timeout for HistoryRecord

Any idea why this would happen? There are no problems if I try to start the activity again, the thread just keeps running as it was.

Just discovered something else. The thread pauses just fine if I leave the activity within about a second of having started it. And then it will resume and pause again with no problems at all while the same task is still running. I have no idea why for a short period of time it will work, but if I leave it too long, it won't.

Okay... I fixed it. But I don't think I'm supposed to do what I've done. I've basically removed any synchronization with mSurfaceHolder from both the pause() and the setState() methods (which is used by pause()). No it works as it's supposed to, but I'm thinking the synchronization is there for a reason.

Perhaps the best question for me to ask is this: WHEN should you synchronize a thread with an object by use of a synchronized block? And in this case, what is the purpose of synchronizing with the SurfaceHolder?

View 1 Replies View Related

Android :: Pause N Resume The Activity?

Jan 20, 2009

How to pause and resume the activity?

View 3 Replies View Related

Android : Avoiding An Activity To Destroy - Just Stopping Or Pausing It When Pushing The Back Button

Mar 19, 2010

I would like to pausing or putting the application on background when pressing the back button, I don't want the application to go through the destroy state. Things are when I override onKeyDown and when I force to pause or stop the application by using onPause, I have some issuees with the wakelock and application crash, but when I press home button I go through onPause method and I have no exception, it's weird!

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 :: OnPause() - Resume To An Activity Which Has A Bundle Passed To It When Created

Mar 11, 2010

I have an application where I navigate from Activity A to Activity B and back to A and then B. I want to resume the activity B (which has a Bundle passed to it ) from Activity A. The documentation says that OnSaveInstance() is called only when the activity is killed, so how do i use OnPause which does not have the Bundle to resume the activity B.

View 13 Replies View Related

Android :: Data Of Previous Activity Gone When New Activity Starts

Dec 30, 2009

I am developing an application in which the user require to register first and than got the user page. For that i have made layout and the layout consist many fields, so, i have made part of layout and also made the separate activity for the each layout. The layout like address, phone, etc... After that i have wrote the code for calling an activity and it works fine. It means when i press the "Next" button the another page will come and it will also consist some textview ,edittext and previous and next button. Actually, i want something different like -- When the user fill the first form and he will proceed to next, the content written by the user should not gone when the user press "Next" button. The content should be there which was written by user. And same way i have have 6 pages like that way to complete the registration process. So, have you any idea to solve above problem? I really need your help because right now i stuck at this point. So, please any body help me out of this problem. I would appreciate your help. I am waiting for your reply.

View 15 Replies View Related

Android :: Disable Activity Slide-in Animation When Launching New Activity?

Feb 18, 2010

have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.

View 5 Replies View Related

Android :: Launching Activity From Status Bar Creates New Activity / Even When One Already Exists

Nov 9, 2010

I have an activity that starts a long-running service which in turn adds an icon to the status bar. When the activity gets invisible, e.g. by pressing the Home button, and the pressing the icon in the status bar a new activity is created instead of showing the already created activity. If you now press the back button the new activity is destroyed and the activity created in the first place gets visible. How do I make the invisible activity brought to front when pressing the icon in the status bar instead of creating a new activity?

View 1 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 :: 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 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...

View 6 Replies View Related

Android :: Resume Activity And Play Audio File After Spawned Thread Completes Download?

Jan 13, 2010

I've got an activity that calls a helper class called DownloadManager. DownloadManager spawns a thread that downloads a mp3 to the sdcard. I'm having some trouble finding the best design for resuming the initial activity and starting the MediaPlayer. Does it make the most sense to use a BroadcastReceiver that receives a message that download is complete, then start a new Intent of my activity? Think I saw something that I can't use an Intent to start an Activity from BroadcastReceiver because it is a background process.

View 4 Replies View Related

Android :: Video Playback On VideoView Disappears After Going Back From Another Activity / Why Is So?

Jun 8, 2010

I have two Activities: one with VideoView attached to MediaPlayer and the second one.
I start watching a video in the first Activity, then during playback I start second Activity.
After going back to first Activity I can hear sound but see no picture.

My Video Layout...

Do you have any ideas why video doesn't appear?

View 2 Replies View Related

Android :: Activity Starts Remote Service

Oct 8, 2010

My initial activity is basically a splash screen while preforming initialization and login in to network server. To save memory I want to finish() the splash activity once it starts the main menu activity. I still want the remote service to operate. Testing shows it does. But am I going to get into trouble doing this? I know I can restart the remote from the main menu activity but I am trying to save overhead by not starting it twice. The remote service is required by the splash activity.

View 1 Replies View Related

Android :: Best Way For Service That Starts Activity To Communicate With It

Feb 16, 2010

I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL (http://developer.android.com/guide/developing/tools/aidl.html), but this seems to not be effective. I think AIDL is only effective when the process that is to be talked to is a service, not when it is an activity? I would love some directions or suggestions on how to solve my problem.

View 1 Replies View Related

Android :: How To Find Out When Activity Starts Or Get Focus?

Mar 17, 2010

I would need to know when one activity starts or get's focus. I need this notification for any activity regardless of his type, name or whatever - not searching for one specific activity. Checked the ActivityMonitor and the Intent and I haven't found a generic intent for this purpose. Or I hadn't understood well the descriptions from the Intent ACTION_xxxxx.

View 7 Replies View Related

Android :: How To Start Animation When Activity Starts?

Aug 21, 2010

I need to start a animation automatically for a activity without any user clicking. I know when activity is not ready, animation could not start. I used a thread to start it, however it is still not working.

View 4 Replies View Related

Android :: Set Focus On TextView When Activity Starts?

Aug 16, 2010

There are an EditText and a TextView in my Activity. I want to set focus on the TextView when the Activity starts. I used the following code:

TextView myTextView = (TextView) findViewById(R.id.my_text_vew);
myTextView.setFocusable(true);
myTextView.setOnClickListener(this);
myTextView.requestFocus();

But the code doesn't work. The EditText always receives focus when the activity starts.

View 1 Replies View Related

Android :: Launching Another Activity From Application

May 22, 2010

I am trying to launch another application from my Activity. Something weird happens when I am running this code :
Intent myIntent = new Intent( Intent.ACTION_MAIN, null );
myIntent.addCategory( Intent.CATEGORY_LAUNCHER );
myIntent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED );
ComponentName compName=new ComponentName(myArray[i][0], myArray[i] [1] );
// String[][] myArray myIntent.setComponent( compName ); startActivity( myIntent );

I have this error :
android.content.ActivityNotFoundException: Unable to find explicit activity class { com.android.settings/com.android.settings.Settings};
Have you declared this activity in your AndroidManifest.xml?
But when I replace this line
// myArray[i][0] = "com.android.settings" // myArray[i][1] = "com.android.settings.Settings" ComponentName compName=new ComponentName(myArray[i][0], myArray[i] [1] );
with ComponentName compName=new ComponentName("com.android.settings","com.android.settings.Settings");
And without any modification in my manifest, it works!

View 2 Replies View Related







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