从SDK级别android.intent.action.SIM_STATE_CHANGED广播意图的支持? [英] From which SDK level is android.intent.action.SIM_STATE_CHANGED broadcast intent supported?

查看:2300
本文介绍了从SDK级别android.intent.action.SIM_STATE_CHANGED广播意图的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在市场上的应用程序(SIM锁定的通知)的依赖于当接收到广播意图为* android.intent.action.SIM_STATE_CHANGED * ..反应我公司开发的应用程序的最新版本的广播接收器,4.0 0.3(即SDK 15级),现在我想它的兼容性扩展到较低的水平(提供不可用的东西运行时检查,如操作栏或preference片段)......现在的问题是,我想..这意图无证了解,如果也产生在旧平台上的* SIM_STATE_CHANGED *事件,它甚至不是*平台/ Android的15 /数据/在SDK中broadcast_actions.txt *中找到的..我应该挖成来源来理解它的实施和到哪个SDK的水平?这是一个的特定供应商的的事件?我有一个在其上工作的HTC One X的。

I have an app in the market (SIM Locked Notifier) that relies on a broadcast receiver that reacts upon receiving a broadcast intent for *android.intent.action.SIM_STATE_CHANGED*.. I developed the app for the latest version, 4.0.3 (i.e. SDK level 15) and now I'd like to extend its compatibility to lower levels (providing runtime checks for unavailable things, like action bar or preference fragments)... The problem is that I'd like to understand if the *SIM_STATE_CHANGED* event is generated also on older platforms.. This intent is undocumented, it is not even found within the *platforms/android-15/data/broadcast_actions.txt* within the SDK.. Should I dig into the sources to understand where it is implemented and down to which SDK level? Is this a vendor-specific event? I have an HTC One X on which it works.

推荐答案

我不知道关于你的第一个question.But我可以帮助你在回答第二个问题。

I am not sure about your first question.But i can help you out in answering Second question.

,现在我想它的兼容性扩展至较低水平
  (提供不可用的东西运行时检查,如操作栏或
  preference片段)

and now I'd like to extend its compatibility to lower levels (providing runtime checks for unavailable things, like action bar or preference fragments)

反射将帮助你在这种情况下。
使用反射,你可以查询类可用的方法,构造等。

Reflection will help you out in this case. Using reflection you can query class for available methods,constructors etc.

假设你想要使用的PopupMenu在application.And它可能是你的应用程序依然如此
想在pre 4.0 devices.So使用反射运行

Suppose you want to use PopupMenu in your application.And it may be the case that you application still want to run on pre 4.0 devices.So use reflection

继code段和谷歌搜索位将帮助你。

Following code snippet and bit of Google search will help you out.

String sClassName = "android.widget.PopupMenu";  
    try {  
        Class classToInvestigate = Class.forName(sClassName);   
        Yes!!! Class is aviliable now do whatever you want to do with PopupMenu.
        // Dynamically do stuff with this class  
        // List constructors, fields, methods, etc.  

    } catch (ClassNotFoundException e) {  
        // Class not found!  
        it means application is running on pre 4.0 version device.
    } catch (Exception e) {  
        // Unknown exception  
    }  

这篇关于从SDK级别android.intent.action.SIM_STATE_CHANGED广播意图的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆