So I am following this tutorial, using Sublime as a text editor and compiling everything from console.
All was working good, but when we came to the part where you
It really helped much until I got a successful build. They also confused me with the MainActivity sometimes referring to MyActivity. So anyway the DisplayMessageActivity.java file looks as above and for a successful I had the MyActivity.java code as below:
package com.example.myfirstapp;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.widget.EditText;
public class MyActivity extends Activity {
//public class MyActivity extends ActionBarActivity {
public final static String EXTRA_MESSAGE = "com.mycompany.myfirstapp.MESSAGE";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
/** Called when the user clicks the Send button */
public void sendMessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
}
And now I can run my apk :-)