/data/data/アプリケーション名/databases フォルダ内のファイル名の一覧取得・表示
package com.test;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class Test01Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Context con = this;
String[] str = this.databaseList();
Log.d("個数", String.valueOf(str.length));
TextView textView1 = (TextView) findViewById(R.id.textView1);
String text = "";
for (int i = 0; i < str.length; i++) {
text += str[i] + "\n";
}
textView1.setText(text);
}
}

0 件のコメント:
コメントを投稿