ну, почти все в вопросе, у меня проблема с программой, которая должна использовать sqlite, она по-прежнему возвращает «непредвиденную ошибку», мне просто интересно, нужно ли мне запускать какой-то сервер, deamon или службу?
androidManifest [фрагмент]
<activity android:name=".About">
android:label="@string/about_title"
android:theme="@android:style/Theme.Dialog" >
</activity>
<activity android:name=".Exit">
andorid:label="@string/exit_title">
</activity>
<activity android:name=".Options">
</activity>
<activity android:name=".Start">
</activity>
<activity android:name=".Create">
</activity>
</application>
AndroidSQLite
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sql);
TextView listContent = (TextView)findViewById(R.id.contentlist);
mySQLiteAdapter = new SQLiteAdapter(this);
mySQLiteAdapter.openToWrite();
mySQLiteAdapter.deleteAll();
mySQLiteAdapter.insert("ABCDE");
mySQLiteAdapter.insert("FGHIJK");
mySQLiteAdapter.insert("1234567");
mySQLiteAdapter.insert("890");
mySQLiteAdapter.insert("Testing");
mySQLiteAdapter.close();
mySQLiteAdapter = new SQLiteAdapter(this);
mySQLiteAdapter.openToRead();
String contentRead = mySQLiteAdapter.queueAll();
mySQLiteAdapter.close();
listContent.setText(contentRead);
}
sql.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/app_name"
/>
<ListView
android:id="@+id/contentlist"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
main.xml [фрагмент]
<Button
android:id="@+id/where_button"
android:onClick="WhereCl"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/where_label" />
код, отвечающий за кнопку «Где я?»
mainActivity.java
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View startButton = findViewById(R.id.start_button);
View whereButton = findViewById(R.id.where_button);
View aboutButton = findViewById(R.id.about_button);
View exitButton = findViewById(R.id.exit_button);
}
public void OptionsCl(View v){
startActivity(new Intent(this,Options.class));
}
public void WhereCl(View v){
startActivity(new Intent(this,AndroidSQLite.class));
}
public void StartCl(View v){
Intent idd = new Intent(this,Start.class);
startActivity(idd);
}
public void AboutCl(View v){
startActivity(new Intent(this,About.class));
}
public void ExitCl(View v){
finish();
}
}
Ошибка, которую я получаю, аналогична той, которая возникает с незарегистрированным действием, нодействие зарегистрировано [проверьте код]
это просто "приложение blabla (menu.dot) неожиданно остановилось. Пожалуйста, попробуйте еще раз" Принудительное закрытие.