Exceção de fragmento do Android: atividade não encontrada
Estou usando onavigation-drawer
modelo no eclipse para fazer um aplicativo Android simples. Estou com alguns problemas com fragmentos. Declarei um fragmento chamado PresenceLog Fragment em manifesto, mas quando o chamei emMainActivity
, o log ainda diz que
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?
Aqui está o meu manifesto
Aqui está a minha classe de fragmento
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);
}
Aqui está minha MainActivity
private void launchPresenceLog(){
Intent intent = new Intent(this,PresenceLogFragment.class);
startActivity(intent);
}
Seria ótimo se você soubesse o que há de errado com meu código. Além disso, como eu sou novo na programação do Android, eu apreciaria se você pudesse sugerir alguns cursos on-line.