Category : class

i’ve been working on Android App in AndroidStudio. Application has Fragment, let’s call it MainFragment, and seperate Java Class file, let’s call it SQLiteControler.class The problem is when i try to call method from Fragment in SQLiteController im getting null object reference as error Here is some minified code: MainFragment public class MainFragment extends Fragment ..

Read more

I want to use postRecyclerView variable in fragment class to home class.. because I want to scroll position when I add post. but in home class I have to define recyclerview. so I plan to use recyclerview variable from fragment class. Here is home class code. myRef.setValue(post).addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { ..

Read more

I have the below code in the ProfileActivity.java: public class ProfileActivity extends AppCompatActivity { ImageView imageView; private static final int PICK_IMAGE = 100; Uri imageUri; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_profile); final ImageView exampleImage = (ImageView) this.findViewById(R.id.exampleImageView); exampleImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // [TODO] Implement application behavior when the ..

Read more