StartSubActivity in view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

StartSubActivity in view

Postby perkal » Sat Nov 22, 2008 4:12 pm

Hi all!

I have a Activity with a view that it activates with the function setContentView(), i.e. the view class handles methods like onTouchEvent(), onKeyDown()... etc, and the necesary methods for move a objetct on the screen. Well, actually when the object arrives at determinate points on the screen (implemented with a rectangle) I want to start a new activity, i use:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3. Intent intent = new Intent(contexto, PasoExperimento150.class);
  4.  
  5. contexto.startActivity(intent);
  6.  
  7.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Where "contexto" is the context that i store in the constructor:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public VistaPaso140(Context context, int imagen) {
  3.  
  4. //....
  5.  
  6.  
  7.  
  8. contexto = context;
  9.  
  10. }
  11.  
  12.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Now I want pass data between activities, but the method "startActivityForResult" is not disponible for context class. It is disponible only on activity class.

How can I do this¿?

Thanks.
perkal
Freshman
Freshman
 
Posts: 5
Joined: Mon Oct 27, 2008 11:04 am

Top

Postby perkal » Mon Nov 24, 2008 5:13 pm

I answer to myself, in case anyone has the same question:

I pass the data between activities in the same way that michels indicates in the following post:

http://www.anddev.org/passing_object_as ... t2715.html
perkal
Freshman
Freshman
 
Posts: 5
Joined: Mon Oct 27, 2008 11:04 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 1 guest