XML file:
<Button android:id="@+id/btn" android:onClick="launchSettings" android:text="button" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
java file:
public void launchSettings(View v){ //Launch a new activity Intent i = new Intent(this,SettingActivity.class); startActivity(i); }
After adding these functionality you will be able to launch new Activity.
以上是Launch new Activity(Intent)的详细内容。更多信息请关注PHP中文网其他相关文章!