LOG里大量出现
"Unexpected value from nativeGetEnabledTags: 0"
在logcat的过滤器的log message字段中输入以下过滤串
^(?!.*(nativeGetEnabledTags)).*$
public class MainActivity extends Activity {
String PASS = "myPassWord.txt";
Button addbtn, readbtn, modifybtn, savebtn;
EditText addet, modifyet;
TextView tv;
ScrollView sv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
s...
public class MainActivity extends Activity {
private TextView tv1, tv2, tv3, tv4, tv5, tv6, tv7, tv8, tv9, tv10, tv11,
tv12, tv13, tv14;
private EditText et1, et2, et3;
private Button bt1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedIns...
public class Calculate {
/**
* @param args
*/
private final static char[] arrayoperate = { '+', '-', 'x', '/' };
public char getOperate() {
Random rdm = new Random();
return arrayoperate[rdm.nextInt(4)];
}
public int getData2() {
Random rdm = new Random();
r...
SQLite 數據庫
SQLite 版本控制類 SQLiteOpenHelper
@Override
onCreate();//只有在設備上不存在要獲取的數據庫時才會調用。
@Override
onUpgrade();
// 在更新表結構時, 只需要修改構造方法中的數據庫版本號,并在onUpgrade()方法中更新表結構的 SQL語句。
**************************************************************************...
总结
总之Context在Android系统中的地位很重要,它几乎无所不能,但它也不是你想用就能随便用的,谨防使用不当引起的内存问题。如果还有疑问或者想了解更多内容,可以去看我的:视频课程
本文参考阅读:
http://blog.csdn.net/guolin_blog/article/details/47028975
http://blog.csdn.net/yanbober/article/details/45967639
文/尹star(简书作者)
原文链接:http://www.jianshu.com/p/94e0f9ab3f1d
著作权归作者所有,转载请...
public class Httpthread extends Thread{
String url;
WebView webView;
Handler handler;
public Httpthread(String url, WebView webView,Handler handler){
this.url=url;
this.webView=webView;
this.handler=handler;
}
public void run(){
try {
URL httpUrl=new URL(url);
t...
myweb = (WebView) findViewById(R.id.web);//找不到id时设置Project->Build Automatically,
myweb.loadUrl("http://www.baidu.com");
public class MainActivity extends Activity implements OnClickListener {
private TextView tv;
private Button bt1;
private Button bt2;
private Button bt3;
private Button bt4;
private Button bt5;
private Button bt6;
private Button bt7;
private Button bt8;
private Button bt9;
pr...
public class MyView extends View{
private int count=0;
public MyView(Context context) {
super(context);
}
public void onDraw(Canvas canvas){
int color = 0;
switch(count){
case 0:
color=Color.BLUE;
break;
case 1:
color=Color.LTGRAY;
break;
case 2:
c...
public class MainActivity extends AppCompatActivity {
public Button firstButton;
private Button secondButton;
private SQLiteDB dbHelper;
private final String dbName="helperdb";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedIn...
public class MainActivity extends Activity {
private Button btn;
private ProgressDialog dialog; //进度条
private MyAsyncTasck myAsyncTasck;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layo...
package com.example.postvalue;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class M...
package com.example.dialog;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.Menu;
import...
public class MainActivity extends Activity {
private Gallery gallery;
private ImageSwitcher switcher;
private List<Integer> lst;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
galle...
package com.example.android_12_28;
import java.util.List;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
public class OneImageAdapter extends BaseAdapter {
private List<I...
public class MainActivity extends Activity {
private ListView listView;
private List<User> userList;
private List<String> list;
private List<String> list2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.lay...
public class MainActivity extends Activity {
private MapView mMapView;
private LocationClient locationClient;
private BaiduMap baiduMap;
private boolean firstLocation;
private BitmapDescriptor mCurrentMarker;
private MyLocationConfige...