글쎄, 내 프로그램은 지금까지, compilable 및 모든 머물고, 나는 그것에 소리를 추가하려고, 그래서 "원시"폴더를 만들었고, mp3 파일에 갇혀있다. 그런 다음 사용하려고 시도했는데 어떤 이유로 든 오류가 발생하기 시작했습니다. Ctrl + Z를 눌러 사운드가 추가되기 전에 다시 돌아올 때까지 기다립니다. 프로그램은 여전히 오류가 발생했습니다. 난 원시 폴더를 삭제하고 여전히 오류가 있습니다 [아래 프로그램에 표시] 이건 내 프로그램에서 단 한 클래스이며 다른 것들이 있습니다.내 레이아웃을 해결할 수없는 이유는 무엇입니까? (안드로이드/자바)
package scouting.form;
import android.R;//Don't use android.R here; use a fully qualified name for each usage instead - this one only comes up *sometimes...*
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class Login extends Activity {
Button login;
EditText user;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);//Error: activity_login cannot be resolved or is not a field
login=(Button) findViewById(R.id.button1);//NO ERROR even though the next line has an error...
user=(EditText) findViewById(R.id.editText1);//Error: editText1 cannot be resolved or is not a field
login.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent openScouting = new Intent("com.cody.graham.SCOUTING");
startActivity(openScouting);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_login, menu);//Error: activity_login cannot be resolved or is not a field
return true;
}
}
나는 그들이 거기에, 나는 레이아웃을 열고 여전히에있는 레이아웃 "activity_login"의 텍스트 편집 상자가 있음을 확인할 수 있습니다 전체 시간이었다, 레이아웃 및 메뉴가 여전히 있다는 것을 알고 레이아웃 폴더 및 편집 텍스트 상자에는 줄이 있습니다.
이 있습니다.
나는 무엇을 말할 지 모르겠다. 나는 그것을 한순간에 제거했다. 나는 그것이 내가 필요로하는 수입이 없다고 불평했다. 그래서 나는 그것을 다시 첨가했다. 내가 그것을 제거했을 때 이번에는 ... (페이스 팔먼?) 어쨌든, 감사합니다 !! – bluebl1
@ bluebl1 여러분을 환영합니다! 왼쪽에있는 체크 표시를 선택하여 정답으로 표시하는 것을 잊지 마십시오. ;) – Eric
내가 다시 말하고있는 문제가 있습니다. 나는 지금 "import.android.R"을 가지고 있지 않지만 다음 줄을 가지고있다. 'clr = (Button) findViewById (R.id.CLREntries);' "CLREntries"를 해결할 수 없다는 메시지가 나타납니다. 이 페이지의 레이아웃에서이 라인의 버튼이 있습니다 : 'android : id = "@ + id/CLREntries"' 그리고 오류가 없습니다 버튼으로. – bluebl1