[Solved] Picasso recycle view retrofit 2 in grid view

Change adapter = new DataAdapter(data,context); line to adapter = new DataAdapter(data,YourActivity.this); then, go to the Adapter class, and paste public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private ArrayList<dashboard.Dashboard_info> android; private Activity activity; public DataAdapter(ArrayList<dashboard.Dashboard_info> android,Activity activity) { this.android = android; this.activity = activity; } now use picasso with Picasso.with(activity).load(android.get(i) .getWeek_image()) .resize(250,200) .into(viewHolder.img_android); solved Picasso recycle view … Read more

[Solved] How do I add two view types in a Recycler adapter? I want to make a Android Chatting App [closed]

You should use getItemViewType() of the RecyclerView.Adapter. Return different values for different views in that callback. You will receive that value in viewType of onCreateViewHolder callback. Inflate different layouts based on the viewType. solved How do I add two view types in a Recycler adapter? I want to make a Android Chatting App [closed]

[Solved] Need to draw a shape for android in xml, the design will hold a “X” and some vertical and horizontal line also [closed]

I recommend using a <vector> drawable for this. <vector xmlns:android=”http://schemas.android.com/apk/res/android” android:width=”24dp” android:height=”24dp” android:viewportWidth=”24.0″ android:viewportHeight=”24.0″> <path android:strokeColor=”#000″ android:strokeWidth=”1″ android:pathData=”M1 1h22v22h-22zM1 1l22 22M1 23l22 -22M1 12h22M12 1v22″/> </vector> solved Need to draw a shape for android in xml, the design will hold a “X” and some vertical and horizontal line also [closed]

[Solved] What’s wrong in this code for firebase database? [closed]

You need to change this line of code: mDatabaseReference.child(“drivers”).child(userid).toString() != userid || mDatabaseReference.child(“parents”).child(userid).toString() != useremail) { with mDatabaseReference.child(“drivers”).child(userid).getRef().toString() != userid || mDatabaseReference.child(“parents”).getRef().child(userid).toString() != useremail) { As you probably see, i have added the getRef() method to actually get the reference. Hope it helps. 7 solved What’s wrong in this code for firebase database? [closed]

[Solved] go to last item in recyclerview [closed]

After setAdapter() or inside onClick function write this code : recyclerView.scrollToPosition(data.size() – 1); recyclerView : is your RecyclerView object data : your ArrayList 0 solved go to last item in recyclerview [closed]

[Solved] Listener doesn’t work..It seems the Listener is 0

Extension of my comment above: You need to register the mListener somehow. A pattern to do this is: public class MyHandler { private LoginListener mListener; public MyHandler(LoginListener listener) { mListener = listener; } // … etc… } Where LoginListener is: public interface LoginListener { public void onLoginSuccess(); } And your activity has: public MyActivity implements … Read more

[Solved] How to set specific time in Toast?

What you can do i use Calendar class to get the current time. Check the time and display the toast accordingly. Calendar currentTime = Calender.getInstance(); int hour = currentTime.get(Calendar.HOUR_OF_DAY); if(Use your condition here) { Display toast } else if(Use your other condition) { Display toast } Just a note, your hour would be in 24 … Read more

[Solved] How can i load a link in other browser from web view?

Try this: webView.setWebViewClient(new WebViewClient(){ public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url != null && (url.startsWith(“http://”) || url.startsWith(“https://”))) { view.getContext().startActivity( new Intent(Intent.ACTION_VIEW, Uri.parse(url))); return true; } else { return false; } } }); 2 solved How can i load a link in other browser from web view?

[Solved] I only created a blank activity and the app keeps crashing. The logcat shows several FATAL EXCEPTIONS

@ Stephanie-JK when you create a new project i think you have select a BASE Activity hence arrive this problem. Next time when you create a new project please select a Empty Activity then its generate a only one Layout and your problem resolve..thanks 9 solved I only created a blank activity and the app … Read more

[Solved] How to change mic icon with send button when user starts typing in android [closed]

Just add TextChangedListener on EditText: EditText commentText=(EditText)findViewById(R.id.edit); commentText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { String val=charSequence.toString(); // chaeck if edittext have any character or empty. then // there are two way to handle switch … Read more

[Solved] String not compared in the second activity

Use Bundle to pass Strings between activities private Button b1; static EditText et; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); et = (EditText)findViewById(R.id.pass); b1 = (Button)findViewById(R.id.clickhere); b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String pass = et.getText().toString(); if(pass.equals(getString(R.string.Ronnie)) || pass.equals(getString(R.string.Ankita))) { Intent myIntent = new Intent(MainActivity.this, Thought.class); myIntent.putExtra(“pass”,pass); startActivity(myIntent); }else{ Toast.makeText(getApplicationContext(),”Not for … Read more

[Solved] Why can’t i call a method within a protected method of the same class [duplicate]

Introduction When writing code in an object-oriented language, it is important to understand the concept of access modifiers. Access modifiers are used to control the visibility of class members, such as methods, variables, and constructors. One of the access modifiers is the protected modifier, which allows a class to access its own members, but not … Read more

[Solved] Why can’t i call a method within a protected method of the same class [duplicate]

You are creating local variables of button1, button2 etc inside the onCreate method. This way, the generateQuestion method is unaware of these variables and uses the class variables with the same name (not included in your code, but I imagine you have somewhere declared them probably on top of your activity class) which are not … Read more