首先,我创建了一个显示警告对话框的类.
收到服务器的响应,调用方法通过传递应用程序上下文来显示警告对话框
package io.omoto.omotokairaliapp.Utls;import androID.content.Context;import androID.vIEw.WindowManager;import com.gitonway.lee.niftymodaldialogeffects.lib.NiftyDialogBuilder;import io.omoto.omotokairaliapp.Constants.Constants;/** * Created by ${venkIE} on ${28/1/16}. */public class displayRegisteredMessage { Context context; private NiftyDialogBuilder dialogBuilder; public displayRegisteredMessage(Context context) { this.context = context; } public voID displayMessage() { if (Constants.FLAG == 1) { Constants.FLAG = 0; dialogBuilder = NiftyDialogBuilder.getInstance(context); dialogBuilder .withTitle("Response is already registered") .withMessage("For this Customer we have already taken response Sorry!!"); dialogBuilder.getwindow().setType(WindowManager.LayoutParams.TYPE_SYstem_ALERT); dialogBuilder.show(); } else { } }}
上面的代码显示警告对话框
@OverrIDe public voID onSuccess(int statusCode,header[] headers,JsONObject response) { super.onSuccess(statusCode,headers,response); Log.e("response page",response.toString()); try { if (response.getString(Constants.STATUS).equalsIgnoreCase("SUCCESS")) p7.deleterecord(p7b.getFlowID()); p7.deleteRows(); Constants.FLAG = 1; displayRegisteredMessage displayRegisteredMessage = new displayRegisteredMessage(mContext); displayRegisteredMessage.displayMessage(); } catch (JsONException e) { e.printstacktrace(); } Log.e("Page 6",p7b.getFlowID()); }总结
以上是内存溢出为你收集整理的如何在应用程序android中的任何活动上显示警报对话框全部内容,希望文章能够帮你解决如何在应用程序android中的任何活动上显示警报对话框所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)