Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DatabaseHelper myDb;
- myDb = new DatabaseHelper(this);
- @Override
- public void onBindViewHolder(homeAdapter.ViewHolder holder, int position) {
- holder.homeAuth.setText(authList.get(position));
- holder.homeName.setText(nameList.get(position));
- holder.homeIntro.setText(introList.get(position));
- holder.homePk.setText(pkList.get(position));
- holder.itemView.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- final Context context = v.getContext();
- final String serverURL = "http://youngh.cafe24app.com/qrock/views/qrock_pk/user_email";
- myDb = new DatabaseHelper(this); //is it Possible?
- final String token = myDb.getToken();
- final String email = myDb.getEmail();
- Intent myIntent = new Intent(context, mainActivity.class);
- context.startActivity(myIntent);
- ((Activity) context).finish();
- ((Activity) context).overridePendingTransition(R.xml.madefadein, R.xml.splashfadeout);
- }
- });
- }
- DatabaseHelper myDb;
- myDb = new DatabaseHelper(context);
- class YourAdapter extends RecyclerView.Adapter<YourViewHolder>{
- private DatabaseHelper myDb;
- public YourAdapter(Context context){
- myDb = new DatabaseHelper(context)
- }
- }
Add Comment
Please, Sign In to add comment