久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='LPRW7'><style id='LPRW7'><dir id='LPRW7'><q id='LPRW7'></q></dir></style></legend>

          <bdo id='LPRW7'></bdo><ul id='LPRW7'></ul>

      1. <small id='LPRW7'></small><noframes id='LPRW7'>

        <tfoot id='LPRW7'></tfoot>

      2. <i id='LPRW7'><tr id='LPRW7'><dt id='LPRW7'><q id='LPRW7'><span id='LPRW7'><b id='LPRW7'><form id='LPRW7'><ins id='LPRW7'></ins><ul id='LPRW7'></ul><sub id='LPRW7'></sub></form><legend id='LPRW7'></legend><bdo id='LPRW7'><pre id='LPRW7'><center id='LPRW7'></center></pre></bdo></b><th id='LPRW7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LPRW7'><tfoot id='LPRW7'></tfoot><dl id='LPRW7'><fieldset id='LPRW7'></fieldset></dl></div>

        在 Android 中從一個活動移動到另一個活動

        Moving from one activity to another Activity in Android(在 Android 中從一個活動移動到另一個活動)

          <tfoot id='RecsK'></tfoot>

              <tbody id='RecsK'></tbody>
              <legend id='RecsK'><style id='RecsK'><dir id='RecsK'><q id='RecsK'></q></dir></style></legend>
              • <bdo id='RecsK'></bdo><ul id='RecsK'></ul>
                <i id='RecsK'><tr id='RecsK'><dt id='RecsK'><q id='RecsK'><span id='RecsK'><b id='RecsK'><form id='RecsK'><ins id='RecsK'></ins><ul id='RecsK'></ul><sub id='RecsK'></sub></form><legend id='RecsK'></legend><bdo id='RecsK'><pre id='RecsK'><center id='RecsK'></center></pre></bdo></b><th id='RecsK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RecsK'><tfoot id='RecsK'></tfoot><dl id='RecsK'><fieldset id='RecsK'></fieldset></dl></div>

                <small id='RecsK'></small><noframes id='RecsK'>

                • 本文介紹了在 Android 中從一個活動移動到另一個活動的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想從一項活動轉移到另一項活動(使用虛擬設備).當我點擊按鈕移動時,我的模擬器會出現一個對話框,顯示 不幸的是 SMS1 已停止工作(SMS1 是我的應用程序名稱).

                  I want to move from one activity to another (using virtual device). When I click on button to move, My emulator ones a dialog box showing unfortunately SMS1 has stopped working (SMS1 is my app name).

                  誰能幫我更正我的代碼?

                  Can anybody help me in correcting my code?

                  MainActivity.java:

                  package com.example.sms1;
                  
                   import android.os.Bundle;
                   import android.app.Activity;
                   import android.content.Intent;
                   import android.view.Menu;
                   import android.view.View;
                   import android.view.View.OnClickListener;
                   import android.widget.Button;
                   import android.widget.TextView;
                  
                   public class MainActivity extends Activity implements OnClickListener
                   {
                  
                  Button b1;
                  TextView tv1;
                   @Override
                   protected void onCreate(Bundle savedInstanceState)
                   {
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.activity_main);
                      b1 = (Button) findViewById(R.id.button1);
                      tv1 = (TextView) findViewById(R.id.textView1);
                  
                      b1.setOnClickListener(this);
                  
                   }
                  
                  @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;
                  }
                  
                  @Override
                  public void onClick(View v)
                  {
                      // TODO Auto-generated method stub
                      Intent i = new Intent(getApplicationContext(),NextActivity.class);
                      startActivity(i);
                      setContentView(R.layout.avtivity_next);
                  }
                  
                  
                  
                  }
                  

                  這是 NextActivity

                  package com.example.sms1;
                  
                  import android.os.Bundle;
                  import android.app.Activity;
                  import android.view.Menu;
                  import android.widget.TextView;
                  
                  public class NextActivity extends Activity {
                  
                  TextView tv1;
                  @Override
                  protected void onCreate(Bundle savedInstanceState) {
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.avtivity_next);
                      tv1 = (TextView) findViewById(R.id.textView1);
                  }
                  
                  
                  @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;
                  }
                  
                  }
                  

                  Manifest.XML

                  <?xml version="1.0" encoding="utf-8"?>
                  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                  package="com.example.sms1"
                  android:versionCode="1"
                  android:versionName="1.0" >
                  
                  <uses-sdk
                      android:minSdkVersion="8"
                      android:targetSdkVersion="17" />
                  
                  <application
                      android:allowBackup="true"
                      android:icon="@drawable/ic_launcher"
                      android:label="@string/app_name"
                      android:theme="@style/AppTheme" >
                      <activity
                          android:name="com.example.sms1.MainActivity"
                          android:label="@string/app_name" >
                          <intent-filter>
                              <action android:name="android.intent.action.MAIN" />
                  
                              <category android:name="android.intent.category.LAUNCHER" />
                          </intent-filter>
                      </activity>
                  </application>
                  
                  </manifest>
                  

                  NextActivityLayout

                  <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=".NextActivity" >
                  
                  <TextView
                      android:id="@+id/textView1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="next activity" />
                  
                  
                  
                  </RelativeLayout>
                  

                  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=".MainActivity" >
                  
                  <TextView
                      android:id="@+id/textView1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="@string/hello_world" />
                  
                  <Button
                      android:id="@+id/button1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_below="@+id/textView1"
                      android:layout_marginTop="80dp"
                      android:layout_toRightOf="@+id/textView1"
                      android:text="Button" />
                  
                  </RelativeLayout>
                  

                  推薦答案

                  你還沒有在 AndroidManifest.xml 文件中定義 NextActivity.

                  You haven't defined NextActivity in the AndroidManifest.xml file.

                  </activity>標簽之后添加這些行.它應該可以工作.

                  Add these lines in android manifest after</activity> tag. It should work.

                  <activity
                      android:name=".NextActivity" >
                  </activity>
                  

                  最終代碼將是

                  <application
                      android:allowBackup="true"
                      android:icon="@drawable/app_icon"
                      android:label="@string/app_name" >
                      <activity
                          android:name=".MainActivity"
                          android:label="Main Activity" >
                          <intent-filter>
                              <action android:name="android.intent.action.MAIN" />
                  
                              <category android:name="android.intent.category.LAUNCHER" />
                          </intent-filter>
                      </activity>
                      <activity
                          android:name=".NextActivity" >
                      </activity>
                  </application>
                  

                  這篇關于在 Android 中從一個活動移動到另一個活動的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                    <tfoot id='iJ65l'></tfoot>
                  • <legend id='iJ65l'><style id='iJ65l'><dir id='iJ65l'><q id='iJ65l'></q></dir></style></legend>

                    <small id='iJ65l'></small><noframes id='iJ65l'>

                  • <i id='iJ65l'><tr id='iJ65l'><dt id='iJ65l'><q id='iJ65l'><span id='iJ65l'><b id='iJ65l'><form id='iJ65l'><ins id='iJ65l'></ins><ul id='iJ65l'></ul><sub id='iJ65l'></sub></form><legend id='iJ65l'></legend><bdo id='iJ65l'><pre id='iJ65l'><center id='iJ65l'></center></pre></bdo></b><th id='iJ65l'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iJ65l'><tfoot id='iJ65l'></tfoot><dl id='iJ65l'><fieldset id='iJ65l'></fieldset></dl></div>
                      • <bdo id='iJ65l'></bdo><ul id='iJ65l'></ul>
                            <tbody id='iJ65l'></tbody>

                            主站蜘蛛池模板: 91精品国产91久久久久久最新 | 精品99在线 | 国产乱码高清区二区三区在线 | 中文字幕免费视频 | 亚洲精品久久久9婷婷中文字幕 | 亚洲欧美中文日韩在线v日本 | 日韩中文字幕免费 | 欧美日韩一本 | 国产精品久久久久久久久久久久久久 | 一区二区福利视频 | 精品国产精品三级精品av网址 | 在线看av的网址 | 日韩在线播放第一页 | 久久小视频 | av成年人网站 | 日韩中文字幕在线视频 | av在线电影网站 | 久久精品一区 | 精品一区二区三区在线观看 | 97人人澡人人爽91综合色 | 日韩精品一区二区三区视频播放 | 日韩av在线中文字幕 | 国产清纯白嫩初高生视频在线观看 | 91久久久久久久久久久久久 | 国产夜恋视频在线观看 | 日韩欧美在线免费观看视频 | 国产婷婷色一区二区三区 | 国产精品永久免费视频 | 国产日韩一区二区 | 中文字幕在线第二页 | 国产第一页在线播放 | 中文精品一区二区 | 国产精品成人一区二区三区吃奶 | 中文字幕日韩在线观看 | 男人的天堂亚洲 | 亚洲精品在线免费播放 | 亚洲性网 | 亚洲视频一区二区三区四区 | 毛片网在线观看 | h片免费在线观看 | 日韩美女一区二区三区在线观看 |