Dank Meme Bro further Question

0 Ananth Venkatesh · August 28, 2015
Want to integrate your gesture lesson further into this app.
How can I OnFlick on my MainActivity and get the text on my Meme?
I mean how do I send a signal to the Fragment from the MainActivity?

Post a Reply


Oldest  Newest  Rating
0 Dol Lod · August 31, 2015
What signal are you looking for? You could create a variable to hold the fragment when it is created and modify it through there.

Explain a bit more about what you are trying to do.

Think about where the work makes the most sense to do:

Is it better in the fragment or the main activity?

Where should the signal be received, the main activity or the fragment?
0 Ananth Venkatesh · September 2, 2015
I did this in my topfragment.

public void onFlick(){

And this on my MainActivity

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
topfragment topline = (topfragment) getSupportFragmentManager().findFragmentById(R.id.fragment);
return true;

public boolean onTouchEvent(MotionEvent event) {
return super.onTouchEvent(event);

But app crashes as soon as I flick. Can somebody help.
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator