[转]Android开发中常用工具类总结-… 分类: Android开发 2014-05-30 10:54 74人阅读 评论(0) 收藏
http://m.blog.csdn.net/blog/tcgwl/14450547
出自:http://blog.csdn.net/krislight/article/details/11354119
项目中常会遇到的工具类 总结留存
首先Activity的抽象类 BaseActivity
项目中常会遇到的工具类 总结留存
首先Activity的抽象类 BaseActivity
[java] view
plaincopy
-
-
public
abstract class BaseActivity extendsActivity { -
-
private static final String class.getSimpleName();TAG = BaseActivity. -
-
public static int MSGTYPE_DEFAULT 0;= -
-
public static int MSGTYPE_INFO 1;= -
-
public static int MSGTYPE_WARNING 2;= -
-
public static int MSGTYPE_ERROR 3;= -
-
-
@Override -
protected void onCreate(Bundle savedInstanceState) { -
super.onCreate(savedInstanceState); -
} -
-
-
protected abstract void init(); -
-
-
protected abstract void initListener(); -
-
-
public String intgetResStr( id) -
{ -
return this.getResources().getString(id); -
} -
-
-
protected void showShortToast( intresId) { -
Toast.makeText(this, getString(resId), Toast.LENGTH_SHORT).show(); -
} -
-
-
protected void showShortToast(String text) { -
Toast.makeText(this, text, Toast.LENGTH_SHORT).show(); -
} -
-
-
protected void showLongToast( intresId) { -
Toast.makeText(this, getString(resId), Toast.LENGTH_LONG).show(); -
} -
-
-
protected void showLongToast(String text) { -
Toast.makeText(this, text, Toast.LENGTH_LONG).show(); -
} -
-
-
protected void showLogDebug(String tag, String msg) { -
Log.d(tag, msg); -
} -
-
-
protected void showLogError(String tag, String msg) { -
Log.e(tag, msg); -
} -
-
-
protected void startActivity(Class
版权声明:本文为博主原创文章,未经博主允许不得转载。

浙公网安备 33010602011771号