ビューにメソッドをアタッチするファイルactivity.java
がありますsetContentView(R.layout.x);
。添付はファイルに含める必要があります。どうすれば含めることができますか。y.xml
Linear Layout
onclick()
onclick()
activity.java
y.xml
私はこれを試しました、
1. layout = (LinearLayout) findViewById(R.layout.y);
eView = (EditText)layout. findViewById(R.id.editview);
2. eView = (EditText)findViewById(R.id.editview);
しかし、どちらも my を与えnull pointer exception
ます。editText
アップデート
final LayoutInflater lyInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
showLinearLayout = (LinearLayout) lyInflater.inflate(R.layout.y, null);
showView = (EditView) showLinearLayout.findViewById(R.id.edittext);