OSDN Git Service

intentで記録を受信できるようにする(準備)
[gokigen/JoggingTimer.git] / wear / src / main / java / net / osdn / gokigen / joggingtimer / stopwatch / MainActivity.kt
index cde6422..cef8992 100644 (file)
@@ -77,6 +77,26 @@ class MainActivity : AppCompatActivity(), IClickCallback, ITimeoutReceiver, ICou
         {
             e.printStackTrace()
         }
+
+        try
+        {
+            val receivedAction = intent.action
+            if (receivedAction == Intent.ACTION_SEND)
+            {
+                val thread = Thread {
+                    // 取得したSENDインテントを処理する
+                    val importer = IntentSendImporter()
+                    importer.handleIntent(intent)
+                }
+                thread.start()
+            }
+        }
+        catch (e: Exception)
+        {
+            e.printStackTrace()
+        }
+
+
     }
 
     /**