2017-05-04 30 views
0

如何使此警報在apis低於19時出現?謝謝。AlertDialog.Builder低於19

AlertDialog.Builder mBuilder = new AlertDialog.Builder(this); 
LayoutInflater inflater = this.getLayoutInflater(); 
View mView = inflater.inflate(R.layout.recover_password_dialog, null); 
Button btnSend = (Button) mView.findViewById(R.id.btnRecuperar); 
final EditText emailRecover = (EditText) mView.findViewById(R.id.emailRecover); 
mBuilder.setView(mView); 
btnSend.setOnClickListener(new View.OnClickListener() { 

這是竊竊私語。

回答

0

可能是你使用

import android.support.v7.app.AlertDialog; 

嘗試將其更改爲

import android.app.AlertDialog; 
+0

我是說。這在api 21上工作正常,但是在19下面顯示警報。 –

+0

它有歪斜嗎?你可以顯示logcat嗎? –

+0

沒有。在19日的21件作品中,100%展示了對話。 –

0

我想你應該可以實現這個進口的AlertDialog類

import android.support.v7.app.AlertDialog; 

讓我知道這是否幫助

0

這很奇怪。

我有一個函數來顯示該對話框。在api 21上工作100%,但不在1上。

我所做的是刪除該函數並在EditText上創建OnClickListener。

並在代碼上改變了這一點。

LayoutInflater inflater = login.this.getLayoutInflater();