I want to call a string in a different class but I am unable to make it public it's showing Modifier 'public' not allowed here.
public void onAccessibilityEvent(AccessibilityEvent event) {
switch (event.getEventType()) {
case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:
String string = event.getText().toString();
I want to call the string in a different class in onStartCommand method as for if statement kindly guide me on how can I call the strig without public, or any other method to achieve it.