0

I am working on an AlertDialog Fragment which is supposed to pop up under certain circumstances, for example usage days of the app. I defined a constant for the current App and simply check if requirements are met before the onCreate is called like this:

if(statistics.getDays()>REQUIREMENT_VARIABLE)
{
 onCreateTest=true;
}

Now I was planning to use this Activity with other applications/build variants (and change the values of the check variables for each individual app) however I was not sure how to go about checking which application is using it. Is a config xml where I define the packages in strings a good way to approach this? Thanks in advance.

wjwj
  • 1
  • 2

2 Answers2

0

I think you should define these variable in your app build.gradle specially for the build variant.

This post may help you.

Hope this helps.

Sorry for my english.

Community
  • 1
  • 1
Cochi
  • 2,199
  • 2
  • 12
  • 15
0

Create new java class along with your activity. Access and use that java class from another application to initialize check variables depends upon your business logic. And use those variables in the mentioned condition.

Sandeep Kharat
  • 500
  • 1
  • 4
  • 12