Sony Small Apps runOnUiThread





The Activity class is used to implement an application which has GUI. However, if you use SmallApplication class for implementation, you can launch the application as a Small Apps. According to the Sony API Reference, the SmallApplication class is similar to the Android Activity class but it doesn’t have the runOnUiThread method.

So let’s implement it:


package com.rosaneng.test;

import android.os.Handler;
import com.sony.smallapp.SmallApplication;

public class MainApplication extends SmallApplication {

public Handler handler;

@Override
public void onCreate() {
handler = new Handler();
super.onCreate();
}
private void runOnUiThread(Runnable runnable) {
handler.post(runnable);
}
}




Leave a Reply

Your email address will not be published. Required fields are marked *