-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix layout and add ServiceBinding.kt
- Loading branch information
srthk
committed
May 8, 2023
1 parent
a87faf3
commit 9947e14
Showing
8 changed files
with
49 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
app/src/main/java/srthk/pthk/smsforwarder/services/ServiceBinding.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package srthk.pthk.smsforwarder.services | ||
|
||
import android.app.Service | ||
import android.content.Intent | ||
import android.os.IBinder | ||
import android.widget.Toast | ||
|
||
class ServiceBinding : Service() { | ||
override fun onBind(p0: Intent?): IBinder? { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { | ||
onTaskRemoved(intent); | ||
Toast.makeText( | ||
applicationContext, "This is a Service running in Background", | ||
Toast.LENGTH_SHORT | ||
).show(); | ||
return START_STICKY; | ||
} | ||
|
||
override fun onTaskRemoved(rootIntent: Intent?) { | ||
val restartServiceIntent = Intent(applicationContext, this.javaClass) | ||
restartServiceIntent.setPackage(packageName) | ||
startService(restartServiceIntent) | ||
super.onTaskRemoved(rootIntent) | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
app/src/main/java/srthk/pthk/smsforwarder/services/SmsListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<resources> | ||
<string name="app_name">Sms Forwarder</string> | ||
<string name="enter_the_number_here_to_which_you_want_to_forward_the_sms_you_recieve">Enter the Number here to which | ||
you want to forward the sms you recieve | ||
</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Jul 07 22:30:53 IST 2020 | ||
#Mon May 08 16:59:23 IST 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |