五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Android Q廣播

2020-06-23 01:15 作者:無情劍客Burning  | 我要投稿

adb shell am broadcast -a "com.mingrisoft" "com.example.myapplication"

代碼實現(xiàn)

AndroidManifest.xml

  1. <?xml version="1.0" encoding="utf-8"?>

  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"

  3. ? ?package="com.example.myapplication">


  4. ? ?<uses-permission android:name="android.permission.BROADCAST_STICKY" />

  5. ? ?<application

  6. ? ? ? ?android:allowBackup="true"

  7. ? ? ? ?android:icon="@mipmap/ic_launcher"

  8. ? ? ? ?android:label="@string/app_name"

  9. ? ? ? ?android:roundIcon="@mipmap/ic_launcher_round"

  10. ? ? ? ?android:supportsRtl="true"

  11. ? ? ? ?android:theme="@style/AppTheme">

  12. ? ? ? ?<activity

  13. ? ? ? ? ? ?android:name=".MainActivity"

  14. ? ? ? ? ? ?android:label="@string/app_name"

  15. ? ? ? ? ? ?android:theme="@style/AppTheme.NoActionBar">

  16. ? ? ? ? ? ?<intent-filter>

  17. ? ? ? ? ? ? ? ?<action android:name="android.intent.action.MAIN" />


  18. ? ? ? ? ? ? ? ?<category android:name="android.intent.category.LAUNCHER" />

  19. ? ? ? ? ? ?</intent-filter>

  20. ? ? ? ?</activity>

  21. ? ? ? ?<receiver

  22. ? ? ? ? ? ?android:name=".MyReciever"

  23. ? ? ? ? ? ?android:exported="true"

  24. ? ? ? ? ? ?android:enabled="true">

  25. ? ? ? ? ? ?<intent-filter>

  26. ? ? ? ? ? ? ? ?<action android:name="com.mingrisoft"></action>

  27. ? ? ? ? ? ? ? ?<action android:name="mingrisoft"></action>

  28. ? ? ? ? ? ?</intent-filter>

  29. ? ? ? ?</receiver>

  30. ? ?</application>


  31. </manifest>

MyReciever.java

  1. package com.example.myapplication;


  2. import android.content.BroadcastReceiver;

  3. import android.content.Context;

  4. import android.content.Intent;

  5. import android.widget.Toast;


  6. public class MyReciever extends BroadcastReceiver {

  7. ? ?private final static String TAG = MyReciever.class.getName();

  8. ? ?@Override

  9. ? ?public void onReceive(Context context, Intent intent) {

  10. ? ? ? ?Toast.makeText(context,"Recieve",Toast.LENGTH_LONG).show();

  11. ? ?}

  12. }

MyApplication.javaintent.setPackage("com.example.myapplication");

  1. package com.example.myapplication;


  2. import android.content.Intent;

  3. import android.os.Bundle;


  4. import com.google.android.material.floatingactionbutton.FloatingActionButton;

  5. import com.google.android.material.snackbar.Snackbar;


  6. import androidx.appcompat.app.AppCompatActivity;

  7. import androidx.appcompat.widget.Toolbar;


  8. import android.view.View;

  9. import android.view.Menu;

  10. import android.view.MenuItem;


  11. public class MainActivity extends AppCompatActivity {


  12. ? ?@Override

  13. ? ?protected void onCreate(Bundle savedInstanceState) {

  14. ? ? ? ?super.onCreate(savedInstanceState);

  15. ? ? ? ?setContentView(R.layout.activity_main);

  16. ? ? ? ?Toolbar toolbar = findViewById(R.id.toolbar);

  17. ? ? ? ?setSupportActionBar(toolbar);


  18. ? ? ? ?FloatingActionButton fab = findViewById(R.id.fab);

  19. ? ? ? ?fab.setOnClickListener(new View.OnClickListener() {

  20. ? ? ? ? ? ?@Override

  21. ? ? ? ? ? ?public void onClick(View view) {

  22. ? ? ? ? ? ? ?/* ?Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)

  23. ? ? ? ? ? ? ? ? ? ? ? ?.setAction("Action", null).show();*/

  24. ? ? ? ? ? ? ? ?Intent intent = new Intent();

  25. ? ? ? ? ? ? ? ?intent.setAction("com.mingrisoft");

  26. ? ? ? ? ? ? ? ?intent.setPackage("com.example.myapplication");

  27. ? ? ? ? ? ? ? ?sendStickyBroadcast(intent);

  28. ? ? ? ? ? ?}

  29. ? ? ? ?});

  30. ? ?}


  31. ? ?@Override

  32. ? ?public boolean onCreateOptionsMenu(Menu menu) {

  33. ? ? ? ?// Inflate the menu; this adds items to the action bar if it is present.

  34. ? ? ? ?getMenuInflater().inflate(R.menu.menu_main, menu);

  35. ? ? ? ?return true;

  36. ? ?}


  37. ? ?@Override

  38. ? ?public boolean onOptionsItemSelected(MenuItem item) {

  39. ? ? ? ?// Handle action bar item clicks here. The action bar will

  40. ? ? ? ?// automatically handle clicks on the Home/Up button, so long

  41. ? ? ? ?// as you specify a parent activity in AndroidManifest.xml.

  42. ? ? ? ?int id = item.getItemId();


  43. ? ? ? ?//noinspection SimplifiableIfStatement

  44. ? ? ? ?if (id == R.id.action_settings) {

  45. ? ? ? ? ? ?return true;

  46. ? ? ? ?}


  47. ? ? ? ?return super.onOptionsItemSelected(item);

  48. ? ?}

  49. }

公眾號

微信公眾號:無情劍客



Android Q廣播的評論 (共 條)

分享到微博請遵守國家法律
康定县| 孟村| 利辛县| 伊宁县| 军事| 石泉县| 九江县| 孟连| 太康县| 手机| 巴彦淖尔市| 上饶县| 元谋县| 延安市| 揭西县| 奉化市| 当雄县| 环江| 新源县| 海林市| 无锡市| 调兵山市| 旬邑县| 望谟县| 林州市| 广丰县| 读书| 会宁县| 玉门市| 华宁县| 海门市| 方正县| 晋中市| 修武县| 涞源县| 民勤县| 勃利县| 梁河县| 昆山市| 墨脱县| 九江县|