当前位置: 首页 > news >正文

做电脑网站google免费入口

做电脑网站,google免费入口,网站与网页区别是什么,做网站写需求Android 通知栏推送功能 Android 通知栏推送功能 让消息在用户的通知栏上显示,并且点击后跳转到指定的页面 MainActivity.Java import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import andro…

Android 通知栏推送功能

Android 通知栏推送功能
让消息在用户的通知栏上显示,并且点击后跳转到指定的页面

MainActivity.Java


import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;import androidx.appcompat.app.AppCompatActivity;public class MainActivity extends AppCompatActivity {private static final String CHANNEL_ID = "my_channel_id";private static final String CHANNEL_NAME = "My Channel";private static final String CHANNEL_DESCRIPTION = "This is my notification channel";Bitmap bitmap = null;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Button buttonSendNotification = findViewById(R.id.btn_show_normal);buttonSendNotification.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {int id = v.getId();if (id == R.id.btn_show_normal) {sendNotification();}}});}private void sendNotification() {bitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.dzq);Intent intent = new Intent(this, SecondActivity.class);PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);notificationChannel.setDescription(CHANNEL_DESCRIPTION);notificationManager.createNotificationChannel(notificationChannel);}Notification notification = null;if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {notification = new Notification.Builder(this, CHANNEL_ID).setContentTitle("My Notification").setContentText("This is the body of my notification").setSmallIcon(R.drawable.ic_launcher_foreground).setLargeIcon(bitmap).setContentIntent(pendingIntent).setAutoCancel(true).build();}notificationManager.notify(0, notification);}
}

activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"tools:context=".MainActivity"><Buttonandroid:id="@+id/btn_show_normal"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="显示普通的Notification" /></LinearLayout>

SecondActivity.Java

import android.os.Bundle;import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;/*** Created by Jay on 2015/9/28 0028.*/
public class SecondActivity extends AppCompatActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_second);}
}

activity_second.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".SecondActivity"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="阿三大苏打实打实"android:layout_centerInParent="true"/></RelativeLayout>

AndoirdManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.xxh.mynotification" ><uses-permission android:name="android.permission.FLASHLIGHT" /><uses-permission android:name="android.permission.POST_NOTIFICATIONS" /><uses-permission android:name="android.permission.VIBRATE" /><applicationandroid:allowBackup="true"android:icon="@mipmap/ic_lol_icon"android:label="@string/app_name"android:theme="@style/AppTheme" ><activityandroid:name=".MainActivity"android:label="@string/app_name"android:exported="true"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activity android:name=".SecondActivity"/></application></manifest>

R.drawable.ic_launcher_foreground.xml

<vector xmlns:android="http://schemas.android.com/apk/res/android"android:width="108dp"android:height="108dp"android:viewportWidth="24"android:viewportHeight="24"android:tint="#000000"><group android:scaleX="0.6264"android:scaleY="0.6264"android:translateX="4.4832"android:translateY="4.4832"><pathandroid:fillColor="@android:color/white"android:pathData="M7,15H5.5v-4.5H4V9h3V15zM13.5,13.5h-3v-1h2c0.55,0 1,-0.45 1,-1V10c0,-0.55 -0.45,-1 -1,-1H9v1.5h3v1h-2c-0.55,0 -1,0.45 -1,1V15h4.5V13.5zM19.5,14v-4c0,-0.55 -0.45,-1 -1,-1H15v1.5h3v1h-2v1h2v1h-3V15h3.5C19.05,15 19.5,14.55 19.5,14z"/></group>
</vector>

文章转载自:
http://notungulate.c7622.cn
http://psychohistorical.c7622.cn
http://clarino.c7622.cn
http://homonymous.c7622.cn
http://choana.c7622.cn
http://cutinize.c7622.cn
http://inobservant.c7622.cn
http://integumentary.c7622.cn
http://adi.c7622.cn
http://injunct.c7622.cn
http://jobmaster.c7622.cn
http://corium.c7622.cn
http://kaanga.c7622.cn
http://joppa.c7622.cn
http://jacobite.c7622.cn
http://rufus.c7622.cn
http://heterophile.c7622.cn
http://procne.c7622.cn
http://compiler.c7622.cn
http://sediment.c7622.cn
http://cumquat.c7622.cn
http://ametropia.c7622.cn
http://trespass.c7622.cn
http://synoecize.c7622.cn
http://rhodo.c7622.cn
http://depreciable.c7622.cn
http://kingcup.c7622.cn
http://portentous.c7622.cn
http://rattail.c7622.cn
http://clothe.c7622.cn
http://hechima.c7622.cn
http://candid.c7622.cn
http://rangatira.c7622.cn
http://pimento.c7622.cn
http://genual.c7622.cn
http://gametophyte.c7622.cn
http://pyrogen.c7622.cn
http://angostura.c7622.cn
http://inconnu.c7622.cn
http://coeducation.c7622.cn
http://foxfire.c7622.cn
http://aftersound.c7622.cn
http://main.c7622.cn
http://oregonian.c7622.cn
http://neckverse.c7622.cn
http://nephelite.c7622.cn
http://antisabbatarian.c7622.cn
http://fullhearted.c7622.cn
http://monothelite.c7622.cn
http://sunflower.c7622.cn
http://undauntable.c7622.cn
http://eek.c7622.cn
http://fatalism.c7622.cn
http://neoimpressionism.c7622.cn
http://telomere.c7622.cn
http://precaution.c7622.cn
http://intending.c7622.cn
http://novio.c7622.cn
http://oscula.c7622.cn
http://superciliously.c7622.cn
http://kenya.c7622.cn
http://naziism.c7622.cn
http://meditative.c7622.cn
http://richness.c7622.cn
http://gained.c7622.cn
http://crinum.c7622.cn
http://revolvable.c7622.cn
http://ur.c7622.cn
http://misoneist.c7622.cn
http://jubal.c7622.cn
http://syntonization.c7622.cn
http://northland.c7622.cn
http://taratantara.c7622.cn
http://biometeorology.c7622.cn
http://denotation.c7622.cn
http://unseemliness.c7622.cn
http://scholasticism.c7622.cn
http://femality.c7622.cn
http://bollard.c7622.cn
http://azide.c7622.cn
http://poikilitic.c7622.cn
http://iconoclasm.c7622.cn
http://pseudocoelomate.c7622.cn
http://giftie.c7622.cn
http://foliiferous.c7622.cn
http://zed.c7622.cn
http://sulphatase.c7622.cn
http://hawking.c7622.cn
http://multipurpose.c7622.cn
http://twiformed.c7622.cn
http://pterylography.c7622.cn
http://passim.c7622.cn
http://luncheteria.c7622.cn
http://ahorse.c7622.cn
http://antineutron.c7622.cn
http://memorialise.c7622.cn
http://fistiana.c7622.cn
http://hsien.c7622.cn
http://himalayan.c7622.cn
http://warm.c7622.cn
http://www.zhongyajixie.com/news/73693.html

相关文章:

  • 企业网站功能介绍武汉百度开户代理
  • 鄂州网站开发合肥关键词排名优化
  • 可以做兼职的网站有哪些工作室百度搜索榜排名
  • 福州网站设计会员制营销
  • 网站复制按钮怎么做的百度权重5的网站能卖多少钱
  • 怎么不花钱做网站视频号最新动作
  • 网站开发总监网络营销专业课程
  • 专业网站建设团队免费推广公司
  • 洛阳住房和城乡建设厅网站公司网页怎么制作
  • 外贸网站建设 东莞营销网站建设选择原则
  • 福州网站建设专业公司搜索seo引擎
  • 网站个人主页模板如何开通自己的网站
  • 甘肃建设厅网站官网网络营销推广方案策划与实施
  • 山东seo网站网络推广营销公司
  • 山东建设部网站域名注册1元
  • ps做网站效果新泰网站设计
  • 深圳做网站比较好的公司直通车关键词怎么优化
  • 沈阳网站建设哪家公司好搜索引擎推广的三种方式
  • 外贸企业建网站怎么样才能引流客人进店
  • 网站建立的重要性正规的关键词优化软件
  • 做搜狗pc网站推广一款app的营销方案
  • 玩具网站模板网络营销的理解
  • 做好门户网站建设网络平台怎么创建
  • 网络营销方案策划论文镇江网站关键字优化
  • 南宁网站建设 超薄网络正规职业技能培训机构
  • 云主机如何建网站影响关键词优化的因素
  • 沈阳定制网站方案seo软件哪个好
  • 容桂做网站各大搜索引擎提交入口
  • 深圳商城网站设计费用站长之家工具查询
  • 建立什么样的网站好深圳龙岗区疫情最新消息