У меня есть игра GamePanel, которая расширяет Surfaceview с помощью контекстного кода ниже.Android: Как перейти от MainActivity к Surfaceview
public GamePanel(Context context)
{
super(context);
this.mContext = context;
mContext = getContext();
//add the callback to the surfaceholder to intercept events
getHolder().addCallback(this);
thread = new MainThread(getHolder(), this);
//make gamePanel focusable so it can handle events
setFocusable(true);
}
Теперь я использовал это, чтобы перейти к моему классу MainMenu из GamePanel.
Intent intent = new Intent(mContext, MainMenu.class);
mContext.startActivity(intent);
Вот мой вопрос: Как я могу вернуться из MainMenu деятельности к деятельности GamePanel, которая проходит SurfaceView при нажатии кнопки?
EDIT: Вот верхняя линия моей GamePanel деятельности:
public class GamePanel extends SurfaceView implements SurfaceHolder.Callback
'Activity' не может распространяться' SurfaceView'. Вы делаете что-то неправильно. Покажите верхние строки класса, где вы видите 'public class GamePanel extends ...', поэтому мы видим, что ваш GamePanel действительно –
Вот верхняя строка кода – DavidPrabhu