Java tutorial
//package com.java2s; import android.app.Activity; import android.widget.RatingBar; public class Main { public static void setRaiting(Activity r, final RatingBar v, final String value) { r.runOnUiThread(new Runnable() { @Override public void run() { try { v.setRating(new Float(value)); } catch (Exception e) { } } }); } }