标签:
java:
public class ShopInfoActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_shop_info); } }
xml:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 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" > <TextView android:id="@+id/tv_text_shop_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="店名:" android:textSize="20sp"/> </RelativeLayout>
//意图 Intent it = new Intent(); //跳转activity it.setClass(MainActivity.this, ShopInfoActivity.class); //意图开启 startActivity(it);
<activity android:name="com.appdemo.eatwhat.ShopInfoActivity"> </activity>
标签:
原文地址:http://www.cnblogs.com/superdo/p/5155917.html