本文介绍了iPhone手机应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家晚上好.
我是android编程的初学者(所以您可以告诉我欢迎)
并且我需要有关用于管理iPhone电池电量的Android应用程序"这一主题的帮助.
我不明白如何通过android下的应用程序来恢复电池的状态(水平).
预先感谢您的朋友
Good evening everyone.
I''m a beginner in programming android (so you can tell me welcome)
and I need help on this subject "Android Application for managing the battery consumption of iphones".
I can not understand how one can recover the state (level) of the battery by an application under android.
thank you in advance friends
推荐答案
registerReceiver( batteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED) );
private BroadcastReceiver batteryReceiver = new BroadcastReceiver() {
@Override
public void onReceive( Context context, Intent intent )
{
int level = intent.getIntExtra( "level", 0 );
//do what ever you want with level
// check it or call UI update routine
}
}
/Darren
/Darren
这篇关于iPhone手机应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!