I had this error: "error: cannot find symbol method GetApplicationContext()" when I'm creating Fragments for Android app.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void simple(View v){
Intent intent = new Intent(intent.GetApplicationContext(), SimpleFragmentActivity.class);
startActivity(intent);
}
}
getApplicationContext
is not a method of the Intent class but of context.Change
with
or simply
where
this
refers to this object, the Activity, that extendsContextWrapper