草庐IT

intent适配

全部标签

android - FirebaseMessagingService 无法覆盖 zzb 中的 zzae(Intent)。较弱的引用错误

我目前正在使用firebase-messaging9.4.0,在构建应用程序时出现错误我收到一条错误消息错误:(18,8)错误:FirebaseMessagingService中的zzae(Intent)无法覆盖zzb中的zzae(Intent)试图分配较弱的访问权限;受到保护所以我检查了编译后的FirebaseMessagingService,它是com.google.firebase.iid.zzb的子类,zzae(Intent)方法是私有(private)的,但它的子类FirebaseMessagingService具有protected访问权限我知道子类的引用不能比它的父类(s

java - Firebase 列表适配器构造函数错误

我创建了一个显示聊天消息的函数,我遵循了教程,还查看了Firebase列表适配器的文档,但无论我做什么,我都会收到此错误:Error:(98,19)error:constructorFirebaseListAdapterinclassFirebaseListAdaptercannotbeappliedtogiventypes;required:FirebaseListOptionsfound:Chat,Class,int,DatabaseReferencereason:actualandformalargumentlistsdifferinlengthwhereTisatype-var

android - 使用 Intent.createChooser 使用 Waze 和谷歌地图导航显示 Waze 图标两次

我在找到答案后创建了这个问题,我不确定礼节,但它seemstobeOK(另外,我现在看到有一个内置选项)。问题如标题所述,我们使用类似于以下的代码创建了一个Intent选择器:Stringurl="waze://?ll="+latitude+","+longitude+"&navigate=yes";IntentintentWaze=newIntent(Intent.ACTION_VIEW,Uri.parse(url));StringuriGoogle="google.navigation:q="+latitude+","+longitude;IntentintentGoogleNav

Android AlarmClock ACTION_SET_ALARM Intent 产生异常

给定的示例产生异常(android.content.ActivityNotFoundException:找不到处理Intent的Activity)Intenti=newIntent(AlarmClock.ACTION_SET_ALARM);i.putExtra(AlarmClock.EXTRA_MESSAGE,"NewAlarm");i.putExtra(AlarmClock.EXTRA_HOUR,hours);i.putExtra(AlarmClock.EXTRA_MINUTES,mins);startActivity(i);在我的SGS2Android版本2.3.3上。你有什么想法

android - GCM android 推送通知始终显示旧消息。收到的 Intent 不正确

我有一个完美运行的GCM通知实现。但是,问题是一旦在received方法的Intent中接收到消息,显示的消息始终是旧消息。那就是“extras.getString("payload")”总是显示旧消息。我似乎无法弄清楚问题出在哪里。发送GCM通知的类是:importandroid.app.Notification;importandroid.app.NotificationManager;importandroid.app.PendingIntent;importandroid.content.BroadcastReceiver;importandroid.content.Conte

android - Intent 始终为 null onStartCommand

我有以下代码@OverridepublicintonStartCommand(Intentintent,intflags,intstartId){if(intent!=null){Log.i("INTENT",intent.getAction().toString());}returnSTART_STICKY;}但它总是在线返回NullPointerException:Log.i("INTENT",intent.getAction().toString());为什么?我在上面检查“intent”变量是否不为空。如果是这种情况,请执行以下代码。但我仍然遇到nullpointerexcep

android - 通过 Intent 关闭另一个 Activity 的 Activity

我想从第一个Activity开始,我想关闭第一个Activity。我试过了,但接收器不工作。我的应用程序中有不同的接收者,所以我希望这个Intent只从FirstReceiver接收。我该怎么做?publicclassFirstextendsActivity{@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_first);Intentclose=newIntent(getApplicati

需要 Android 通知 : Intent. FLAG_ACTIVITY_NEW_TASK?

在Notification类的文档中,我看到了这个:publicPendingIntentcontentIntentTheintenttoexecutewhentheexpandedstatusentryisclicked.Ifthisisanactivity,itmustincludetheFLAG_ACTIVITY_NEW_TASKflag,whichrequiresthatyoutakecareoftaskmanagementasdescribedintheTasksandBackStackdocument.Inparticular,makesuretoreadthenotifi

android:将可序列化对象放入 Intent 中的问题

嗨,我有一个类的问题,我想通过将它放入putExtras()来传递一个Intent它是可序列化的,代码如下所示:publicabstractclassObjectAextendsArrayListimplementsjava.io.Serializable{...}publicclassObjectBextendsObjectA{...}...Bundleextras=newBundle();extras.putSerializable("blabla",ObjectB);intent.putExtras(extras);...Objecty=getIntent().getExtras

Macbook pro m2适配2k显示器

最近搞了一个hdmi切换器,把macbook也接显示器上了,但是2k显示器如果选2560x1440的话字太小,选其他的因为没有HiDPI所以很糊,唯一有HiDPI的720p字又太大,网上搜了一些开启HiDPI的方法,又太复杂,这里推荐一款软件,使用非常简易BetterDisplay据说是Betterdummy的升级版,我的配置是m2芯片,系统是Monterey12.6,亲测可用下载链接:https://github.com/waydabber/BetterDisplay安装完毕后,选择小齿轮打开设置选择自己的显示器,然后自定义分辨率,记得按加号确定,一开始括号里没有HiDPi是正常的,这里可以