草庐IT

HAS_PHONE_NUMBER

全部标签

android - 将冒号添加到 InputType.TYPE_CLASS_NUMBER 键盘

如何将冒号(:)添加到输入类型InputType.TYPE_CLASS_NUMBER的软键盘目前我有以下代码:NumberKeyListenerkeyListener=newNumberKeyListener(){publicintgetInputType(){returnInputType.TYPE_CLASS_NUMBER;}@Overrideprotectedchar[]getAcceptedChars(){returnnewchar[]{'0','1','2','3','4','5','6','7','8','9','.',':','-',','};}};mytext.setK

android - 禁用时 ActionBar 中的半透明图标 : only on my phone?

我在我的应用程序上使用ActionBarSherlock,当我在ActionBar中禁用某些MenuItem时,图标在我的手机上变成半透明的(HTCOneX运行Android4.0.4),但我没有在任何其他手机上看到这种行为或模拟器。我假设此行为不是nativeActionBar的默认行为是否正确?不过我喜欢这个想法...它警告用户MenuItem由于某种原因未启用(在我的例子中,它是一个保存按钮,如果至少有一个字段未填充,它会禁用该按钮)。我正在考虑为自己提供一个半透明图标,并在禁用MenuItem时手动设置它。这将适用于每个Android版本,无论是否为原生ActionBar。问题

Python 中 AttributeError: Int object Has No Attribute 错误

int数据类型是最基本和最原始的数据类型之一,它不仅在Python中,而且在其他几种编程语言中都用于存储和表示整数。只要没有小数点,int数据类型就可以存储任何正整数或负整数。本篇文章重点介绍并提供了一种解决方案,以应对我们在Python中使用int数据类型时可能发生的特定错误。修复Python错误AttributeError:‘int’objecthasnoattributeAttributeError是Python代码中可能出现的常见错误之一。本教程处理一个这样的AttributeError,即“int”对象没有属性“A”。这里,A可以是在int对象上使用的任何函数。在继续示例代码并学习如

java - 安卓 : How to Check if incoming SMS number exist in contact phone in BroadcastReceiver and block is number not exist

我想当有号码未联系的传入短信时,然后block中的文本,通过检查是否有任何号码不在电话簿中来确定。我有一个代码检查号码存在,但是我在BroadcastReceiver类中移动代码时出错?如何在onReceive中调用方法contactExists?publicbooleancontactExists(Contextcontext,Stringnumber,ContentResolvercontentResolver){Cursorphones=contentResolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI

android - 如何将多个 project_number/sender id 放入 google-services.json

我希望能够在我的Android应用程序中添加多个发件人ID。来自https://developers.google.com/cloud-messaging/concept-optionsGCMallowsmultiplepartiestosendmessagestothesameclientapp.Forexample,supposetheclientappisanarticlesaggregatorwithmultiplecontributors,andeachofthemshouldbeabletosendamessagewhentheypublishanewarticle.Thi

java - "This Activity already has an action bar supplied by the window decor..."错误

所以我试图创建一个使用自定义工具栏(带有选项卡)的Activity,但出现此错误此Activity已经有一个由窗口装饰提供的操作栏。不要在主题中请求Window.FEATURE_SUPPORT_ACTION_BAR并将windowActionBar设置为false以使用工具栏。这是我的Activity课:importandroid.support.design.widget.AppBarLayout;importandroid.support.v7.app.ActionBar;importandroid.support.v7.app.AppCompatActivity;importan

android - 为什么 SmsManager 在某些设备上需要 READ_PHONE_STATE 权限,而在其他设备上不需要?

该应用程序使用SmsManager发送SMS文本消息。以下方法仅在成功获取用户的SEND_SMS运行时权限后调用。该应用程序以API25为目标。publicstaticvoidsendSmsTextMessage(Contextcontext,Stringnumber,Stringmessage){SmsManagersms=SmsManager.getDefault();intpermissionCheck=ContextCompat.checkSelfPermission(context,Manifest.permission.SEND_SMS);if(permissionChec

android - 获取异常作为失败保存状态 : active Fragment has cleared index: -1 when I am pressing home button of android device

当我按下Android的主页按钮并开始新Activity时,我遇到了一些奇怪的问题。我的堆栈跟踪如下05-1318:06:21.182:E/FragmentManager(5674):Failuresavingstate:activeFragment{411d96d8}hasclearedindex:-105-1318:06:21.182:E/FragmentManager(5674):Activitystate:05-1318:06:22.032:E/ACRA(5674):ACRAcaughtaIllegalStateExceptionexceptionforcom.itguruss

android - ionic 推送 : GCM project number not found in android application

我正在尝试使用ionic.io发送推送通知。这是我所做的:在GCM中创建应用并启用GCMAPI。创建凭据并获取APIkey。在ionic.io仪表板中创建应用创建安全配置文件并添加apikey在ionic.io控制面板中创建一个apitoken我在app.js中的源代码由ionicstartpushdemo生成.run(function($ionicPlatform){$ionicPlatform.ready(function(){varpush=newIonic.Push({"debug":true});push.register(function(token){alert(toke

android - PHONE_CALL 权限在 Dexter 中不起作用

我已经实现了Dexter在我的应用程序中。它适用于CAMERA、EXTERNALSTORAGE和INTERNALSTORAGE权限。我想用Dexter的PHONE_CALL权限打电话.当我调用这样的电话时:IntentcallIntent=newIntent(Intent.ACTION_CALL,Uri.parse("tel:"+strNum));startActivity(callIntent);然后startActivity显示警告调用需要可能被用户拒绝的权限:代码应该显式检查权限是否可用(使用checkPermission)或显式处理潜在的SecurityExceptionles