java - A way to differentiate OnDismiss from dialogfragment - Android Studio -


i need on somehow differentiate ondismiss coming from. i'm using 2 different dialogfragments.

dialogclass1 dialog1 = new dialogclass1(); dialogclass2 dialog2 = new dialogclass2();   public void ondismiss(dialoginterface dialoginterface){      if(dialoginterface.equals(dialog1){          //code#     }else if(dialoginterface == dialog2){          //code#     }    ) 

is there way work?

thanks

if both of different types check instanceof.

if(dialoginterface instanceof dialoginteface1){} 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -