Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindMyPhone #1

Open
jackygrahamez opened this issue Feb 15, 2015 · 2 comments
Open

FindMyPhone #1

jackygrahamez opened this issue Feb 15, 2015 · 2 comments

Comments

@jackygrahamez
Copy link

I tried to run FindMyPhone from Android Studio but there is no activity provided for the Application module. I added an empty MainActivity.

public class MainActivity extends Activity {

}

And created a listing in the mainfest

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

I also notice the mainifest indicates this service is not found android:name="com.example.android.wearable.findphone.SoundAlarmListenerService" >
But I do have SoundAlarmListenerService.java in the path.

When I run the Wearable the alarm does not trigger on the phone.

@android-feng
Copy link

Hi Jacky, I guess you could start the service after boot complete. Like this Answer, make a application without any activity and a service only.

@sperochon
Copy link

Your MainActivity should display the layout and start the service. Then, my phone is well ringing.

public class MainActivity extends Activity {

@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startService(new Intent(this, SoundAlarmListenerService.class));
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants