Compare commits
No commits in common. "master" and "v01" have entirely different histories.
@ -11,12 +11,5 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
|
||||||
android:name=".DisplayMessageActivity"
|
|
||||||
android:label="@string/title_activity_display_message">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
|
||||||
android:value="com.example.myfirstapp.MainActivity" />
|
|
||||||
</activity>
|
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
>
|
>
|
||||||
<EditText android:id="@+id/edit_message"
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:text="Hello World, MainActivity"
|
||||||
android:hint="@string/edit_message" />
|
/>
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/button_send"
|
|
||||||
android:onClick="sendMessage" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Joshs First App</string>
|
<string name="app_name">MainActivity</string>
|
||||||
<string name="edit_message">Enter your message, fu</string>
|
|
||||||
<string name="button_send">Send It, Yo</string>
|
|
||||||
<string name="title_activity_display_message">Da Message</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
package com.example.myfirstapp;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.content.Intent;
|
|
||||||
|
|
||||||
public class DisplayMessageActivity extends Activity
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
Intent intent = getIntent();
|
|
||||||
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
|
|
||||||
TextView textView = new TextView(this);
|
|
||||||
textView.setTextSize(40);
|
|
||||||
textView.setText(message);
|
|
||||||
setContentView(textView);
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,14 +2,9 @@ package com.example.myfirstapp;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.content.Intent;
|
|
||||||
|
|
||||||
public class MainActivity extends Activity
|
public class MainActivity extends Activity
|
||||||
{
|
{
|
||||||
public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
|
|
||||||
|
|
||||||
/** Called when the activity is first created. */
|
/** Called when the activity is first created. */
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
@ -17,13 +12,4 @@ public class MainActivity extends Activity
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user