I am implementing a game in which when you gets out you should continue or start MainActivity from View called from MainActivity. I have tried many things but always go to Application Has Stopped working. Please help.
The Code is
MainActivity.java
package com.example.experiment;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView playG=(TextView)findViewById(R.id.playGame);
playG.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View arg0)
{
setContentView(new Game(getApplicationContext()));
***/*From here i called my Gave.class which extending view
and i want that when the player outs then the program control
again start from here . Please make me under stand what i
doing wrong*/***
}
});
}
}
Game.java
0 comments:
Post a Comment