我正在尝试为android中的电池进行充电记录,并且工作正常.但是问题是我无法检测到电池电量以及充电器的状态.供您参考,我是使用android的初学者,希望有人可以帮助我编写代码.
public class ListViewA extends Activity {
/**Called when the activity is first created.*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
ListView lv= (ListView)findViewById(R.id.listview);
// create the grid item mapping
String[] from = new String[] {"col_1", "col_2", "col_3", "col_4"};
int[] to = new int[] { R.id.item2, R.id.item3, R.id.item4, R.id.item5};
// prepare the list of all records
List> fillMaps = new ArrayList>();
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm");
//get current date time with Calendar()
Calendar cal = Calendar.ge
如果觉得《android电池循环 代码 android-如何为充电日志检测电池电量和状态?》对你有帮助,请点赞、收藏,并留下你的观点哦!