public class base_file_lib extends Activity{
public static int VIBRATION=1; //0:OFF 1:ON(DEfault)
public static int Screen_Color=1; //0:Red,1:Green(Default),2:Blue
/** Called when the activity is first created. */
//Base file 共通class ここから
public void clear() //画面消去
{
TextView screen_view = (TextView ) findViewById(R.id.view_screen);
screen_view.setText(R.string.Clear);
}
public void show_screen1(int Message)
{
TextView screen_view = (TextView )findViewById(R.id.view_screen);
screen_view.setMovementMethod(ScrollingMovementMethod.getInstance());
screen_view.setText(Message);
}
public void show_screen2(int Message,int flag)
{
TextView screen_view = (TextView )findViewById(R.id.view_screen);
String buf_screen=String.format(getString(Message),flag);
screen_view.setMovementMethod(ScrollingMovementMethod.getInstance());
screen_view.setText(buf_screen);
}
public void show_screen3(int Message,int flag,int flag2)
{
TextView screen_view = (TextView )findViewById(R.id.view_screen);
String buf_screen=String.format(getString(Message),flag,flag2);
screen_view.setMovementMethod(ScrollingMovementMethod.getInstance());
screen_view.setText(buf_screen);
}
public void ON_OFF_Vibrate(int vibrate)
{
switch(vibrate)
{
case 1: //1:ONのとき、バイブを鳴らす
vibration();
break;
case 0:
break;
}
}
//バイブレート
public void vibration()
{
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
long[] pattern = new long[]{0,350,500};
vibrator.vibrate(pattern, -1);
}
//Menu部分 ここまで
//Menu部分 ここまで
public void SetColor1(int color)
{
TableLayout Screen_color = (TableLayout)findViewById(R.id.Screen_Color);
Resources res = getResources();
//"オレンジ", "緑(Default)", "青","ピンク","白"
int Orenge_color = res.getColor(R.color.Orenge);
int Lime_color = res.getColor(R.color.Lime);
int Blue_color = res.getColor(R.color.Blue);
int Pink_color = res.getColor(R.color.Pink);
int Gray_color = res.getColor(R.color.Gray);
switch(color)
{
case 0:
Screen_color.setBackgroundColor(Orenge_color);
break;
case 1:
Screen_color.setBackgroundColor(Lime_color);
break;
case 2:
Screen_color.setBackgroundColor(Blue_color);
break;
case 3:
Screen_color.setBackgroundColor(Pink_color);
break;
case 4:
Screen_color.setBackgroundColor(Gray_color);
break;
}
}
//エラーダイアログ
public void Errordialog()
{
AlertDialog.Builder AlertDlgBldr = new AlertDialog.Builder(this);
AlertDlgBldr.setTitle(R.string.Error_dialog_Title);
AlertDlgBldr.setMessage(R.string.Error_dialog_Message);
AlertDlgBldr.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog AlertDlg = AlertDlgBldr.create();
AlertDlg.show();
}
//バージョン
public void Versiondialog()
{
AlertDialog.Builder AlertDlgBldr = new AlertDialog.Builder(this);
AlertDlgBldr.setTitle(R.string.Version_Title);
AlertDlgBldr.setMessage(R.string.VersionMessage);
AlertDlgBldr.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which)
{
}
});
AlertDialog AlertDlg = AlertDlgBldr.create();
AlertDlg.show();
}
//Yes no dialogのひな形
public void Yes_No_Dialog_base()
{
new AlertDialog.Builder(this)
.setTitle("Hello, AlertDialog!")
.setPositiveButton(
R.string.Yes,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.setNegativeButton(
R.string.No,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
}
//Base file 共通class ここまで
}
public class base_project_file extends Activity implements View.OnClickListener{
/** Called when the activity is first created. */
//base.file.jp.base_file_lib lib = new base.file.jp.base_file_lib();
static base.file.jp.base_file_lib lib;
.
.
.
}
こんな感じで定義して
lib.show_screen1(R.string.clear);
という感じで呼んでいます
これでアンダーライン等でなくなり、コンパイルまでできましたが
ボタンを押すと強制終了されます
どこがおかしいのでしょうか?
--
このメールは Google グループのグループ「日本Androidの会」に登録しているユーザーに送られています。
このグループから退会し、グループからのメールの配信を停止するには android-group-j...@googlegroups.com にメールを送信してください。
このグループに投稿するには android-g...@googlegroups.com にメールを送信してください。
http://groups.google.com/group/android-group-japan からこのグループにアクセスしてください。
その他のオプションについては https://groups.google.com/d/optout にアクセスしてください。