1 package jp.sourceforge.gokigen.memoma;
3 import android.app.Activity;
4 import android.app.AlertDialog;
5 import android.app.Dialog;
6 import android.content.Context;
7 import android.view.LayoutInflater;
8 import android.view.View;
9 import android.view.ViewGroup;
10 import android.widget.TextView;
18 public class CreditDialog
20 private Activity context = null;
26 public CreditDialog(Activity arg)
35 public Dialog getDialog()
37 LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
38 View layout = inflater.inflate(R.layout.creditdialog, (ViewGroup) null); // ?? http://www.mail-archive.com/android-developers@googlegroups.com/msg162003.html より
39 //View layout = inflater.inflate(R.layout.creditdialog, (ViewGroup) context.findViewById(R.id.layout_root));
41 TextView text = (TextView) layout.findViewById(R.id.creditmessage);
42 text.setText(context.getString(R.string.app_credit));
43 // ImageView image = (ImageView) layout.findViewById(R.id.crediticon);
44 // image.setImageResource(R.drawable.icon);
46 AlertDialog.Builder builder = new AlertDialog.Builder(context);
47 builder.setTitle(context.getString(R.string.app_name));
48 builder.setIcon(R.drawable.icon);
49 builder.setView(layout);
50 builder.setCancelable(true);
51 return (builder.create());