Исключение Android-фрагмента: активность не найдена
Я используюnavigation-drawer
Шаблон в затмении, чтобы сделать простое приложение для Android. У меня есть проблемы с фрагментом. Я объявил фрагмент под названием PresenceLog Fragment в манифесте, но когда я вызвал его вMainActivity
бревно еще говорит что
03-23 13:54:50.817: E/AndroidRuntime(16750): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.singtel.ricecooker/com.singtel.ricecooker.PresenceLogFragment}; have you declared this activity in your AndroidManifest.xml?
Вот мой манифест
Вот мой фрагмент класса
public class PresenceLogFragment extends Fragment{
private TextView myText = null;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.presence_log, null);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
ArrayList<String> userList = null;
RiceServerRequest newRequest = new RiceServerRequest();
//newRequest.getRequestInfo(this);
}
public void updateUserList(ArrayList<String> userList){
LinearLayout lView = (LinearLayout) getView().findViewById (R.layout.presence_log);
//LinearLayout ll = (LinearLayout)fragment.getView().findViewById(R.id.commentFragmentLayout);
for (int i = 0; i < userList.size();i++){
myText = new TextView(getActivity());
myText.setText(userList.get(i));
lView.addView(myText);
}
//setContentView(lView);
}
Вот мой MainActivity
private void launchPresenceLog(){
Intent intent = new Intent(this,PresenceLogFragment.class);
startActivity(intent);
}
Было бы здорово, если бы вы знали, что не так с моим кодом. Кроме того, поскольку я новичок в программировании для Android, я был бы признателен, если бы вы могли предложить несколько онлайн-курсов.