I have set the layout Test into my app
<activity
android:name="com.example.test.TestActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When I run it it's not take the testactivity. I have run (Run as app) many time. it's take MainActivity. Do someone know how to modified it.
if this is need to somewhere please tell me. What I want is now change the app to run the Testactivity instead of MainActivity
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".TestActivity" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="36dp"
android:layout_marginTop="152dp" android:onClick="btnTest"
android:text="Button" />
</RelativeLayout>
Activity:
public class TestActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public ArrayList<String> GetArray(String input){
ArrayList<String> arr= new ArrayList<String>();
return arr;
}
public void btnTest(View view){
Toast.makeText(getApplicationContext(), "This is test", Toast.LENGTH_SHORT);
}
}