티스토리 뷰


import android.content.Intent;

import android.content.IntentFilter;


Intent bat = registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));


String battLevel = bat.getIntExtra("level", -1)+"%";


TextView textView = (TextView)findViewById(R.id.textView4);

textView.setText( "배터리 : " + battLevel );

댓글
댓글쓰기 폼