-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76caec4
commit 8d041a1
Showing
9 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/telchina/wx/base/ForceOfflineReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.telchina.wx.base; | ||
|
||
import android.app.AlertDialog; | ||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.DialogInterface; | ||
import android.content.Intent; | ||
import android.view.WindowManager; | ||
|
||
import com.telchina.wx.LoginActivity; | ||
import com.telchina.wx.R; | ||
|
||
/** | ||
* Created by zg on 2015/8/12. | ||
*/ | ||
public class ForceOfflineReceiver extends BroadcastReceiver { | ||
@Override | ||
public void onReceive(final Context context, Intent intent) { | ||
AlertDialog.Builder builder=new AlertDialog.Builder(context); | ||
builder.setTitle(R.string.force_offline_title); | ||
builder.setMessage(R.string.force_offline_message); | ||
builder.setCancelable(false); | ||
builder.setPositiveButton(R.string.force_offline_button, new DialogInterface.OnClickListener() { | ||
@Override | ||
public void onClick(DialogInterface dialog, int which) { | ||
ActivityCollector.finishAll(); | ||
Intent intent = new Intent(context, LoginActivity.class); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
context.startActivity(intent); | ||
} | ||
}); | ||
|
||
AlertDialog dialog=builder.create(); | ||
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); | ||
dialog.show(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,4 @@ public View getView(int position, View convertView, ViewGroup parent) { | |
return view; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters