跳至主要内容

android handler abstract err

 Android使用Handler进行实例化(new)时, 如:private Handler handler = new Handler();
    会报错Handler is abstract, cannot be instantiated., 提示使用, 其他实例化方式.

    原因:导入(import)库发生错误, 使用Android的句柄(handler)库, 不是java的句柄库;
    使用import android.os.Handler;代替 import java.util.logging.Handler;

评论

此博客中的热门博文

android hide actionbar

public class MainActivity extends Activity { ActionBar actionBar; //声明ActionBar @Override protected void onCreate( Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView( R .layout.activity_main); actionBar = getSupportActionBar(); //得 到ActionBar actionBar.hide(); //隐藏ActionBar } }

go url encoding

func  QueryUnescape func QueryUnescape (s string ) ( string , error ) QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits. func  QueryUnescape func QueryUnescape (s string ) ( string , error ) QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits.