Skip to content

Tag: kotlin

Convert string to specific int

I am creating foreground notification with ID like so: startForeground(1, notification) When initialising the service I am sending to it some string (ex: Hello). I wish that the service and notification will be bind to this string so I wish to use it as my id. So, how can I convert string to unique ID? For ex…

Map with initial values in abstract class

I have an abstract class which holds some default values as follows BaseRequest.kt Now, for all subclasses, I need anyone who extends the BaseRequest class to override the toMap() function and return a map that has an initial value of route that was initialized in the base class. What I mean by that is that o…

Kotlin App open activity 2 with button CRASH

so this is the error in the logcat however when i try to declare “CreateNoteFragment” in the manifest only the .MainActivity & .SplashScreen appear and does not let me declare the .CreateNoteFragment my CreateNoteFragment also references “BaseFragment” activity as such below error.…

Sorround highlighted word with symbol Android Studio

If I have a word highlighted in android studio, is there any shortcut to surround that word with symbols e.g quotation marks or brackets? E.G From John to “John” or Mary to (Mary) Am aware of only Ctrl + Alt + T which surrounds the word with some functions and expressions from the options. Answer …