Hab ich, aber falsch... Möchte auf FragmentA (Die erste Seite) ein Login machen (mit Hibernate). Und mir dafür die Eingabefelder holen... mit folgendem Code:
public class FragmentA extends Fragment implements OnClickListener {
private Button myLoginBtn;
private Button btnRegister;
private EditText eTextUsername;
private EditText eTextPassword;
String username;
String password;
int schuelerid;
private HttpClient httpclient = null;
private HttpGet httpget = null;
private HttpResponse response = null;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
Log.d("VIVZ","onAttach");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
super.onCreateView(inflater,parent,savedInstanceState);
Log.d("VIVZ","onCreateView");
View eTextUsername = inflater.inflate(R.id.editTextUsername, parent, true); // <---- HIER FEHLER
eTextUsername = (EditText) eTextUsername.findViewById(R.id.editTextUsername);
View eTextPassword = inflater.inflate(R.id.editTextPasswd, parent, true);
eTextUsername = (EditText) eTextPassword.findViewById(R.id.editTextPasswd);
View myLoginBtn = inflater.inflate(R.id.editTextUsername, parent, true);
eTextUsername = (Button) myLoginBtn.findViewById(R.id.btnLogin);
myLoginBtn.setOnClickListener(this);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
return inflater.inflate(R.layout.fragment_a, parent, false);
}
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
return inflater.inflate(R.layout.fragment_a, parent, false);
}