有人建議我使用此代碼,使我的方法的時候一定時間後執行的問題,我修改了一下,現在我有: private Handler mHandler = new Handler();
private Runnable mUpdateTimeTask = new Runnable() {
public void run() {
final long start = mStartTime;
在我遇到了下面的一段代碼(在這裏我插調試屑) ImageView img = null;
public void onCreate(...) {
img = (ImageView)findViewById(R.id.image);
new Thread() {
public void run() {
final Bitmap bmp = Bit
我試圖在加載數據後啓動新的意圖。我使用的處理程序在線程完成時調用方法,然後在此方法中嘗試啓動新的Intent,但每次都崩潰。我已經將其縮小到Intent構造函數中的Context變量。這是我的代碼: /** Called when the activity is first created. */
@Override
public void onCreate(Bundle sa
我嘗試從R.raw播放聲音。內線程/運行 但我不能得到這個工作。
new Runnable(){
public void run() {
//this is giving me a NullPointerException, because getBaseContext is null
MediaPlayer mp = MediaPlayer.create(ge