我遇到了将JSON数据存储到sqlite的问题.这是我正在尝试实施的代码.JSON数据不是特别大,只有40行.
主要活动是:
public class DatabaseActivity extends Activity {
/** Called when the activity is first created. */
public DBAdapter
DBAdapter =new DBAdapter(this);
TextView txt;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Create a crude view - this should really be set via the layout resources
// but since its an example saves declaring them in the XML.
LinearLayout rootLayout = new LinearLayout(getApplicationContext());
txt = new TextView(getApplicationContext());
rootLayout.addView(txt);
setContentView(rootLayout);
// Set the text and call the connect function.
txt.setText("Connecting..."); …Run Code Online (Sandbox Code Playgroud)