मैं एक Android ऐप्लिकेशन के लिए लॉगिन स्क्रीन पाने के लिए कोशिश कर रहा हूँ और अब तक यह मेरा कोड है:एंड्रॉयड imeOptions = "actionDone" काम नहीं कर
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:inputType="text"
android:singleLine="true"
android:imeOptions="actionNext">
<requestFocus />
</EditText>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword"
android:singleLine="true"
android:imeOptions="actionDone" />
<Button
android:id="@+id/buttonLaunchTriage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/login" />
</LinearLayout>
</RelativeLayout>
जब मैं इसे चलाने के लिए प्रयास करते हैं, कुंजीपटल सही से पता चलता चाबियाँ लेकिन जब मैं पासवर्ड दर्ज करने के बाद दबाए जाने की कोशिश करता हूं, कुछ भी नहीं होता है। मैं बटन प्रेस को संभालने के लिए इस का उपयोग कर रहा:
private void setupLoginButton() {
Button launchButton = (Button) findViewById(R.id.buttonLaunchTriage);
launchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText username = (EditText) findViewById(R.id.patient_start_userName_value);
EditText password = (EditText) findViewById(R.id.patient_start_password_value);
try {
if(TriageApplicationMain.validateUser(username.getText().toString(),password.getText().toString(),getApplicationContext()))
{
Toast.makeText(StartActivity.this,
"Launching Triage Application", Toast.LENGTH_SHORT)
.show();
startActivity(new Intent(StartActivity.this, MainActivity.class));
}
else
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
StartActivity.this);
// set dialog message
alertDialogBuilder
.setMessage("Incorrect Credentials")
.setCancelable(false)
.setPositiveButton("OK",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
// if this button is clicked, close
// current activity
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
मैं जानता हूँ कि इस कोड का एक बहुत कुछ है, लेकिन यह बहुत अच्छा होगा अगर कोई मुझे यहाँ मदद कर सकता है। यह एक स्कूल परियोजना के लिए है।
पीएस: मैंने इसे पोस्ट करने से पहले ठोस घंटे के लिए Google के माध्यम से खोज की है, इसलिए कृपया ऐसा करने के लिए आलोचना न करें। यदि आपको एक लिंक मिलता है जो उपयोगी है तो कृपया साझा करें।
वास्तव में क्या आप "किया" से उम्मीद कर रहे हैं मुलायम इनपुट कीबोर्ड में? कीबोर्ड को छुपाएं या लॉगिन की ओर बढ़ें? – waqaslam
मैं एक ही मुद्दे का सामना करना पड़ गया है, जिसे आप जोड़ना होगा: एंड्रॉयड: imeActionLabel = "हो गया" एंड्रॉयड: singleLine = "true" यहाँ जवाब है http://stackoverflow.com/questions/5578991/actiondone -इमोप्शन-इन-वर्क-ऑन-एडिटेक्स्ट-इन-एंड्रॉइड-2-3/5579 9 44 # 5579 9 44 –