this is the same question as “how can I extract data from new to old”.
But in my first action I called setContentView(R.layout.main);. The canvas has a view of the surface.
The only method I know is to call getContext()to get the context and then call startActivity(). But I can’t call startActivityForResult()from the context that I get, it seems that it does not support, I need to call it only in my activity class.
Can anyone give me any opinion?
EDIT:
Here is my code:
public class gameView extends SurfaceView implements SurfaceHolder.Callback
{
public gameView(Context context, AttributeSet attrs)
{
Intent intent = new Intent();
intent.setClass(getContext(), inputCharactorName.class);
getContext().startActivity(intent);
}
}
source
share