Android :: OnActivityResult Fc When Using SurfaceView?

Sep 4, 2010

My app fc when activity that's using SurfaceView as content view calls startActivityForResult(...) and activity that has been started calls finish()

This does not happen if I change content view to something else than SurfaceView.

This would be the requested logcat:

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

Android :: onActivityResult fc when using SurfaceView?


Android :: SurfaceView Vs Custom View / SurfaceView Is Slower

Aug 20, 2010

One using a Surfaceview, and the other using a custom view. According to the android SDK development guide, using a surface view is better because you can spawn a separate thread to handle graphics. Th SDK development guide claims that using a custom view with invalidate calls is only good for slower animations, less intense graphics.However, in my simple app, I can clearly see that using a custom view with calls to invalidate seems to render faster.What do you guys know/think about this?My touchEvent code is exactly the same, and my drawing code is exactly the same. The only difference is that one is all in the UI thread, and the other is using a tread to handle the drawing.

View 1 Replies View Related

Android :: 1.6 - OnActivityResult Is Not Called

Jul 6, 2010

I have a problem with the method "onActivityResult".

I create a new Activity from my main activity:

CODE:.........

The new Activity is ended like this:

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

But the Method onActivityResult seem to be not called

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

View 1 Replies View Related

Android :: How To Show Alert In OnActivityResult?

Jan 26, 2010

I am trying to show custom alert from onActivityResult. I need to inflate it, so am getting context with getApplicationContext() and everything is fine until I execute alertDialog.show() - then it fails with: Unable to add window -- token null is not for an application Do you know why I cannot do it?

View 1 Replies View Related

Android :: OnActivityResult Doesn't Work ?

Dec 31, 2009

I am facing with a problem related startActivityForResult()

To start SecondActivity from FirstActivity :

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

And handles result :

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

To send the message to FirstActivity from SecondActivity :

in SecondActivity :

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

I can't handle the result on onActivityResult in FirstActivity. It never works for my application.

My OS is : 1.5

View 2 Replies View Related

Android :: OnActivityResult And The Settings Menu

Aug 13, 2010

My app requires a network connection so if they don't have one enabled I prompt them to start it. I do this by calling the Wireless & Network settings Activity as such:

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

However, when I run my app in the debugger, onActivityResult is called immediately as my calling activity is exited when it should be called once the settings menu if exited. This premature call also sends a resultCode of Activity.RESULT_CANCEL.

Here is the code from onActivityResult:

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

View 3 Replies View Related

Android :: Get Tow Intent Result In OnActivityResult?

Sep 17, 2010

I am using two intent for various action in my activity and i also used onActivityResult for get result,i want to answer for how to get tow intent result in onActivityResult?anybody knows please give sample code for me..

View 1 Replies View Related

Android :: Can Pass Uri Value From OnActivityResult() To OnClick() ?

Jul 27, 2010

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

The circle not show.....but when i put the DrawO() next to mSurfaceHolder01.addCallback(EX10_04.this);

It draw a circle!

If i want to draw a circle in the onActivityResult event

What shuld i do?

Or if i can pass uri to onClick function ?

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

View 1 Replies View Related

Android :: OnActivityResult Is Not Working When Used In ActivityGroup

Feb 22, 2010

I have a Activitygroup and some activities are part of it.

lets say Activitygroup is DetailsGroup which has a activity by name DetailsActivity.

On certail events DetailsActivity launches another activity ExtraActivity by calling startActivityForResult(intent, 2);

The extraActivity is launched it does its work and before calling finish() of it I am calling setResult(RESULT_OK,mintent);

By doing this I was expecting that the DetailsActivity's onActivityResult() would be called, but instead DetailsGroup activities' onActivityResult() is getting called.

Any idea what changes are required to get DetailsActivity's onActivityResult() called in above scenario?

View 2 Replies View Related

Android :: OnActivityResult Never Called On ActivityGroup

Jul 21, 2010

I'll be brief. I have an application with the following Activities Schema:

A (ActivityGroup) | |__

B (Activity Group) | | | |__

C (Activity) | |__ ... (Other Activities) | |__

D (ListActivity) | | | |__

ListView with a custom adapter with two buttons per row

All the Activities shown on the "diagram" are displayed and visible in real time while the application is being executed.

I'm pushing new list elements from C to the ListView in D. And by clicking each row's buttons I'm trying to edit the data of the row by means of a dialog. The problem is when, in the dialog activity, I perform the setResult() and finish(); the D's onActivityResult() is never called, and I do not know why.

View 3 Replies View Related

Android :: OnActivityResult Called Before OnRestart()

May 4, 2009

I am updating some code from 1.1 to run with the new SDK 1.5. I noticed that onActivityResult is being called before OnRestart.

If Activity A calls activity B. Activity A goes to onPause(), then onStop(). Activity B goes on... finishes and returns.

Activity A starts at onActivityResultf(). So if you try to make a clean exit with onStop(), it will cause nullPointers when it comes back.

View 2 Replies View Related

Android :: OnActivityResult Intent Data Not Correct

Jul 29, 2010

I'm venturing into startActivityForResult for the first time and I'm running into a problem.When a user clicks on a list item of Activity B, it returns "ql_id" to Activity A:Unfortunately, extras.getInt("ql_id") evaluates to "0". Why is this? It should be "1". I am clearly doing something incorrectly.

View 1 Replies View Related

Android :: Does OnActivityResult Get Called When An Activity Is Recreated

Sep 30, 2009

I have a flow A->B->C->D where A desires some information that is obtained by D. B, C, and D propagate the data back through the flow using setResult(RESULT_OK, data) and finish(). All intents in A, B, and C are started with startActivityForResult. However, if B is reclaimed by Android and forced to call onCreate again after C finishes onActivityResult in B is never called and the data never makes it back to A. Is there a way I can be sure that onActivityResult will be called?

View 5 Replies View Related

Android :: OnActivityResult No Longer Being Called After OnDestroy

Jul 3, 2010

OnActivityResult is giving me major headaches. My little game has a title / menu screen. Upon clicking "new game" an Activity is launched which creates a SurfaceView for my game world.

When playing, the player can enter buildings in the game world. Upon entering a building I launch the activity for that particular building from my SurfaveView.

Here is an example:

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

mMap is the SurfaceView. I'm passing a bundle containing the state of the player. In onActivityResult I grab the bundle returned by the store activity and update the player state.

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

mSavedPlayer is later used to set the new player state.

All the above works generally

I can enter stores, buy stuff, leave and the player is updated correctly.

The problem manifests when I press the Home button (or someyimes back button) and onDestroy gets called. My onDestroy method does nothing besides call super.onDestroy();

After onDestroy() gets called onActivityResult no longer gets called.

So:

1) I play the game, everthing works great.

2) I press home and ondestroy is called

3) relaunch my game via launcher icon

4) Resume game. I can still enter and leave stores but onActivityResult is no longer called.

Here is some logcat output. I'm logging each time I enter a relevant method.

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

View 1 Replies View Related

Android :: Recognizer Intent - OnActivityResult() Not Called When No Match

Nov 28, 2010

I have the following issue. I am starting a recognizer intent activity in order to detect speech using the "startActivityForResult" method. I have also an "onActivityResult" method listening for results from the recognizer activity. It works and it detects my speech. The problem is that it is only called when everything is ok or when i cancel the operation, but it is not called if it doesn't find a matching text "RecognizerIntent.RESULT_NO_MATCH" or in the rest of wrong cases "RecognizerIntent.RESULT_........" What is happening? Application is Android 2.1 and I have tested on a Android 2.2 device.

View 1 Replies View Related

Android :: Parent Activity Runs OnCreate Before OnActivityResult Is Called - Sometimes

Aug 5, 2010

The order is:

A: startActivityForResult( B ) B: <dostuff>, call finish() A: onCreate <---- what's this all about A: onActivityResult

This happens for a tiny minority of users. I havn't been able to reproduce or find any common elements. A is the launch activity.

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

View 7 Replies View Related

Android :: Get Dorid Unit Test Instrementation To Call Activity's OnActivityResult()?

Feb 3, 2009

Can you please tell me if you know how to get the Andorid unit test instrementation to call my activity's onActivityResult()?

I can't find anything here: http://code.google.com/android/reference/android/app/Instrumentation.

View 4 Replies View Related

Android : Child Activity Exit By Unexpected Exception - OnActivityResult - Is Not Called

Jun 23, 2010

I have faced with issue about startActivityForResult() and onActivityResult(). If child activity started by the startActivityForResult() exit by unexpected exception the onActivityResult() is not called and I have no any ideas how can I handle this to get application working in a fail-safe manner ?

When my code runs child activity with startActivityForResult() it awaits until onActivityResult() will be invoked to get working further, but onActivityResult() is not calling and my code is "hang- up" (logically).

So the question is how can I handle all possible ways the child activity is finished (normally and by unexpected exception) to get fail-safe code ?

I have check the documentation for this issue but have found nothing relating issue.

View 4 Replies View Related

Android :: FinishFromChild And OnActivityResult Not Firing When Child Starts Activity Of Same Type As Parent

Jun 8, 2010

I have an application, which (for the sake of simplicity) has two types of activities - Overview and DetailView. The Overview activity shows a list of steps and allows the user to start a DetailView activity corresponding to the step chosen.

In the DetailView activity, the user can start another Overview, which shows different steps than the ones in the parent of the current DetailView.

In the Overview, DetailView is started by using startActivityForResult (). In the DetailView, when the user decides to start a second Overview, I call setResult () and finish () and then start the new Overview. In this scenario, onActivityResult () and finishFromChild () do not fire. Instead, they fire when the parent finishes (?).

Code from Overview:

CODE:....

Code from DetailView:

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

View 1 Replies View Related

Android :: Switch To SurfaceView

Mar 25, 2009

Im creating a simple game using a SurfaceView for drawing the Graphics. It works fine, but now I tried to add a title screen, which is (for now) only a LinearLayout and a Start-button, specified in XML. However, when I click this button and try to switch to my SurfaceView (By doing setContentView(R.layout.game), the screen turns black. But if I do setContentView(R.layout.game) immediatly in my Activity.onCreate it works. But not if I start with my Title-screen and then try to switch

View 3 Replies View Related

Android :: SurfaceView On G1 - Crashes

Apr 30, 2009

I am finally testing my application on a G1 and even though it works fine on the emulator, it crashes on the G1

It crashes when it does:

CODE:.........

And the view is defined like this:

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

View 3 Replies View Related

Android :: 2 Mediaplayer Using One Surfaceview

Jun 16, 2009

I want to play 2 videos one after one minimizing delay between each video. so I created 2 mediaplayer, one playing the current video and the other preparing to play the following video.

The 1st video is played correctely but I couldn't get the video track of the second video. only sound without any error.

This is my source code : (note that here, I am using files on sdcard but the application will use files on a web server. that's why I need to prepare the second video while the 1st is playing)

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

View 5 Replies View Related

Android : Put GLSurfaceview On Top On A SurfaceView

Dec 16, 2009

Look at this: http://nhenze.net/?p=172

They show that it is possible to put an GLSurfaceview on top on a SurfaceView. I hope it would be useful.

View 2 Replies View Related

Android :: How To Exit Activity Using SurfaceView

May 18, 2010

When exiting the activity in a thread in a SurfaceView. This log appears in this situation:.............

View 2 Replies View Related

Android :: SurfaceView Fast Enough For Emulation

Sep 11, 2010

For years now I've maintained a Tandy Color Computer Emulator applet on my home page. With the purchase of an Incredible I decided to do a port. Getting it going in Android didn't take long but I'm really surprised how slow it runs. You can literally see the pixels painting. I know there are other successful Android emulators so I must be doing something wrong.

My approach was to use a SurfaceView for rendering. There's a separate thread that runs a virtual 6809 CPU. Whenever that thread updates the emulated video memory, it calls SurfaceHolder.lockCanvas() with a Rect describing the part of the screen requiring a repaint. Then it calls the gfx routines with the resulting Canvas...this is where I did a repaint() in AWT/Swing. The gfx routines are smart enough to just render what's in the clipRect. Perhaps I'm still stuck in AWT but I can't think of any way to make this thing run at an acceptable speed. I tried to coalesce the gfx calls but that didn't work either. Any thoughts?

View 1 Replies View Related

Android :: SurfaceView Transparent Through Its Parent

Feb 11, 2009

I have a SurfaceView that is covering a portion of its parent, a RelativeLayout. I have a background image covering the full RelativeLayout area, and this is my Activity's main layout.

I would like to have the SurfaceView be transparent so that I can see through to the background image on its parent RelativeLayout. I have tried the approach shown in the API Demos example TranslucentGLSurfaceViewActivity, but this succeeds in making the transparency go all the way through my Activity to my desktop!

I'm using the "style/Theme.Translucent" theme on my activity, and setting this on my SurfaceView: mySurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);

The transparency to the desktop it kinda cool, but not what I'm trying to do! Is it possible to make a SurfaceView transparent only through to its parent?

View 2 Replies View Related

Android :: Difficulty Resuming SurfaceView

Apr 24, 2009

I am stuck.My main activity creates and starts a SurfaceView.My app needs to access a listview via the options menu to change properties of the items shown in the view.Two strange things occur:

1.) When I scroll the listview quickly, the list sometimes gets farklempt.Words overlap each other.

2.) When I select the item and the app returns to the main activity, the thread is no longer alive.

If someone out there can offer help I will post the code.This will take a little effort.My code is loosely based upon LunarLander and the GLSurfaceView examples.If there is a good example (more recent example) someone can point me to, that would be boss.

View 8 Replies View Related

Android :: Regaining Focus Using SurfaceView

Mar 23, 2009

I'm currently getting to grips with Android, playing around with the Lunar Lander sample. I've found that if you navigate away from the app (eg, hit the call button) it will destroy the underlying surface (calling surfaceDestroyed). Navigating back (which will trigger onWindowVisibilityChanged) the app will crash, as it will try to draw to the surface without recreating it. Is there some code I can put in onWindowVisibilityChanged (or anywhere else) that will regenerate the SurfaceView's underlying surface and resume execution nicely? It feels like this should be a simple function call but I can't find anything in the API docs.

View 2 Replies View Related

Android :: Processing Events In SurfaceView

Jun 10, 2009

I am creating a custom Widget which extends SurfaceView and I am planning to use it for camera preview.In the main activity I tried to implement some event listeners but can't catch any event.If I press a button the LogCat outputs "Continuing to wait for key to be dispatched" line.Does anyone know how to implement event listeners in main activity using SurfaceView classes?

View 3 Replies View Related

Android :: Use SurfaceView Properly , Nothing Is Drawn

May 31, 2009

I had it working with a normal View but that is to slow. I was told to use SurfaceView but can't figure out how to use OnKey with it and if I should use onDraw or draw? And how do I pass stuff to draw? does it happen automatically? code...

View 3 Replies View Related







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