草庐IT

cancel_work

全部标签

android - 错误广播 Intent 回调 : result=CANCELLED forIntent { act=com. google.android.c2dm.intent.RECEIVE pkg=com.flagg327.guicomaipu(有附加功能)}

我从AndroidStudio的Android监视器收到了该错误。当我通过GCM在真实设备中发送推送通知并且应用程序尚未启动或已被强制停止时,会出现此错误。昨天一切正常,今天根本不工作(仅当应用程序在后台或前台运行时才有效)。我认为这可能是一个AndroidManifest错误,但是我已经厌倦了寻找问题并且找不到任何东西。list......TokenRefreshListenerService.java注册“token”每天都会更新。这是因为,每个使用GCM的Android应用程序都必须有一个InstanceIDListenerService来管理这些更新。publicclassTo

android - Dagger 2 和 android Studio : working but can't see generated classes

我正在尝试在AndroidStudio项目中使用Dagger2。我使用了CoffeeMaker示例。我已经设法使应用程序构建和工作但是:-我没有成功看到生成的代码。-如果我调试,我也看不到它。-此外,DaggerCoffeeApp_Coffee标记为reed(无法解析符号)我的gradle文件是://Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()}dependencies{classpath'com

android - 触摸时 ACTION_CANCEL

我有以下类,它代表一个可触摸的View并绘制一个滑动条。publicclassSlideBarextendsView{privateintprogress;privateintmax;privatePaintbackground;privatePaintupground;privateRectFbar;privatebooleanfirstDraw;publicSlideBar(Contextcontext,AttributeSetattrs){super(context,attrs);progress=0;upground=newPaint();upground.setColor(C

android - 如何将 android 资源 int 转换为字符串。例如。 : android. R.string.cancel?

如何从这个资源int:android.R.string.cancel中获取字符串值“cancel”?谢谢 最佳答案 只需使用Context#getString():Stringstring=getString(android.R.string.cancel);I'vealreadytriedthisapproachbutwithnosuccess...I'veaclass:publicclassMyDialogFragmentextendsDialogFragment{DialogFragment不是Context的子类,因此您需要

android - 摘要 : Take a picture utilizing Camera Intent and display the photo with correct orientation (works on hopefully all devices)

这似乎是世界上最简单的事情:使用默认的相机Activity在您的Android应用中拍照。但是,StackOverflow和Web上的几篇文章中涵盖了许多陷阱,例如,NullIntent被传回、图片的方向不正确或OutOfMemoryErrors。我正在寻找一种解决方案,让我能够通过相机Intent启动相机Activity,检索照片的Uri,然后检索照片的正确方向。此外,我想尽可能避免特定于设备配置(制造商、型号、操作系统版本)的实现。所以我想知道:实现这一目标的最佳方法是什么? 最佳答案 更新:2014年1月2日:我非常努力地避免

安卓机房 : Order By not working

我正在使用新的AndroidORMRoom。我遇到了以下问题,使用带有参数的ORDERBY的查询不起作用。如果我想使用从ORDERBY的参数填充的字段,它不起作用。它只是不排序任何东西。@Query("SELECT*FROMUserORDERBY:orderBYASC")ListsortedFind(StringorderBY);但是,当我将ORDERBY列直接放在查询中以对结果进行排序时,它会按预期工作。@Query("SELECT*FROMUserORDERBYnameASC")ListsortedFind();这是AndroidRoom的错误,还是我做错了什么?

Android .xml 文件 : Why do predefined colors not work for me?

当我看杂项。关于指定颜色的Android教程和示例我经常看到使用了诸如@color/red或@color/black等常量。出于某种奇怪的原因,这对我来说从来没有用过!我总是需要使用“#RGB”、#ARGB、...、#AARRGGBB表示法来指定颜色。当我尝试使用任何助记符常量时,例如"@color/red"我收到如下错误消息:[...]C:\Users\mmo\Test\res\drawable\edit_text.xml:5:error:Error:Noresourcefoundthatmatchesthegivenname(at'drawable'withvalue'@color

android - 是什么导致了 Android 中的 MotionEvent.ACTION_CANCEL?

我正在调试Android上的一些触摸处理内容,并试图弄清楚为什么发送到我的View的onTouchListener的MotionEvent包含cancel操作。我找不到任何关于其原因的文档,希望有人能指出我调试此问题的正确方向-错误代码、源代码或一些常识。 最佳答案 这是你要找的东西吗:“ACTION_CANCEL发生在父进程拥有该议案时,例如,当用户在ListView中拖得足够多时,它将开始滚动,而不是让您按下其中的按钮。您可以在View组文档中找到更多相关信息:onInterceptTouchEvent。”希望这是您正在寻找的答

android - 使用 cancel() 从 AlarmManager 删除警报 - Android

我正在尝试用两种不同的方法创建和删除警报,这两种方法都在应用程序逻辑的不同时刻调用。但是,当我调用AlarmManager的cancel()方法时,警报并没有被删除。这是我的addAlarm()方法:AlarmManageralarmManager=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);Intentintent=newIntent(PROX_ALERT_INTENT);intent.putExtra("ALERT_TIME",alert.date);intent.putExtra("ID_ALERT

android - Dagger2 自定义范围 : How do custom-scopes (@ActivityScope) actually work?

我正在阅读Dagger2ComponentScopesTest的源代码在GitHub上,我看到了为名为@ActivityScope的Activity定义的“自定义范围”,但我在其他项目中看到了它,包括4模块CleanArchitecture有它的@PerActivity范围。但从字面上看,@ActivityScope注解的代码如下:importjava.lang.annotation.Retention;importjava.lang.annotation.RetentionPolicy;importjavax.inject.Scope;/***Createdbyjoesteeleon