我正在尝试为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