36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
package net.typeblog.shelter.ui;
|
|
|
|
import android.app.Activity;
|
|
import android.content.ComponentName;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.ServiceConnection;
|
|
import android.os.Bundle;
|
|
import android.os.IBinder;
|
|
import android.support.annotation.Nullable;
|
|
|
|
import net.typeblog.shelter.ShelterApplication;
|
|
|
|
public class DummyActivity extends Activity {
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
((ShelterApplication) getApplication()).bindShelterService(new ServiceConnection() {
|
|
@Override
|
|
public void onServiceConnected(ComponentName name, IBinder service) {
|
|
Intent data = new Intent();
|
|
Bundle bundle = new Bundle();
|
|
bundle.putBinder("service", service);
|
|
data.putExtra("extra", bundle);
|
|
setResult(RESULT_OK, data);
|
|
finish();
|
|
}
|
|
|
|
@Override
|
|
public void onServiceDisconnected(ComponentName name) {
|
|
// dummy
|
|
}
|
|
});
|
|
}
|
|
}
|