- 浏览: 8418 次
- 性别:
- 来自: 北京
最新评论
文章列表
public class GetBroadcast extends BroadcastReceiver {
private static GetBroadcast mReceiver = new GetBroadcast();
private static IntentFilter mIntentFilter;
public static void registerReceiver(Context context) {
mIntentFilter = new IntentFilter();
mIntentFilter.addDataScheme("pac ...
第一种方法使用地址
String url = "file:///" + "sdcard/download/filename";//filename带扩展名
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.putExtra(Intent.E ...
得到联网方式的方法
public String NetType(Context context) {
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = cm.getActiveNetworkInfo();
String typeName = info.getTypeName().toLowerCase; // WIFI/MOBILE
if(typeName.equals. ...