我的设备与wifi连接,但如果连接wifi如何,但这些没有互联网连接
以下是我的代码,我试图检查是否没有互联网连接
public static boolean isConnectedWifi(Context context) {
NetworkInfo info=null;
if(context!=null){
info= IsNetConnectionAvailable.getNetworkInfo(context);
}
return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI);
}
Run Code Online (Sandbox Code Playgroud)
当没有互联网访问时,它总是返回true
当我滑动时没有删除android推送通知
以下是我尝试实现推送通知的代码
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(context)
.setSmallIcon(icon)
.setContentTitle(title)
.setAutoCancel(true)
.setContentText(message)
.setOngoing(true);
Intent notificationIntent = new Intent(context, MainActivity.class);
notificationIntent.putExtra("Your Message", message);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
notificationIntent.putExtra("type", type);
notificationIntent.putExtra("id", id);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(intent);
notificationManager.notify(NOTIFICATION_ID, mBuilder.build());
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这些问题吗
我正在开发一个项目,但我有点困惑,选择我应该使用哪种技术
我选择AngularJs,但为什么选择AngularJs?
我去WordPress,但为什么WordPress?
有谁能建议我最好的选择?