今天在用某記賬軟件
下面把代碼貼上來吧
LoginActivity
[java]
package com
import android
import ntent
import android
import android
import android
import android
import android
/**
* Activity which displays a login screen to the user
* well
*/
public class LoginActivity extends Activity {
private EditText mPasswordView;
private TextView mLoginStatusMessageView;
private Intent intent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super
setContentView(R
mLoginStatusMessageView = (TextView)findViewById(R
mPasswordView = (EditText) findViewById(R
mPasswordView
@Override
public void onTextChanged(CharSequence s
if(mPasswordView
intent = new Intent(LoginActivity
startActivity(intent)
}
}
@Override
public void beforeTextChanged(CharSequence s
}
@Override
public void afterTextChanged(Editable s) {
}
})
}
@Override
protected void onResume() {
// 由於我知道你會點擊返回鍵反復試驗
mPasswordView
super
}
}
跳轉過去的second
mian
[html]
<merge xmlns:android=
xmlns:tools=
tools:context=
<!
<LinearLayout
android:orientation=
<EditText
android:id=
android:layout_width=
android:layout_height=
android:hint=
android:maxLines=
android:singleLine=
<TextView
android:id=
android:layout_width=
android:layout_height=
android:layout_gravity=
android:layout_marginTop=
android:paddingLeft=
android:paddingRight=
android:text=
</LinearLayout>
</merge>
其實最關鍵的就是知道edittext的一些監聽的函數了
好了
延伸問題
希望和大家多多交流
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26513.html