Closed mustii82 closed 5 years ago
Check out the simple demo please, no need to extend the activity from the library: https://github.com/MFlisar/GDPRDialog/blob/master/app/src/main/java/com/michaelflisar/gdprdialog/demo/MinimalDemoActivity.java
Even in the simple Demo you extend from: extends AppCompatActivity implements View.OnClickListener, GDPR.IGDPRCallback
Check the simple demo and just replace the AppCompatActivity
with whatever activity you want! It shows what functions you need to call when and how. Read the demo and you will see that you don't need any activity, simply something implementing the GDPR.IGDPRCallback
and some context.
The implementation fails here:
public void showDialog(AppCompatActivity activity, GDPRSetup setup, GDPRLocation location) {
FragmentManager fm = activity.getSupportFragmentManager();
if (fm.findFragmentByTag(GDPRDialog.class.getName()) == null) {
try {
if (fm.isStateSaved()) {
return;
}...
I need an AppcompatActivity but can only give an Context
Which context do you have? FragmentActivity
? Normal Activity
? You need some sort of activity to show an android dialog...
i have an normal Activity but the arguments for most methods like showDialog() needs an AppCompatActivity
I can change this to FragmentActivity
but not further... You have two choices:
Will close this. This library is made for app compat (and android x) in the future
Im Using a Framework called Libgdx which extends a class to my MainActivity to work properly.
But this library wants to extend too, that's why I can't use it.
Do you have any suggestions ?