StartServiceActivity.java
Go to the documentation of this file.
00001 /*
00002 copyright 2014 UNL Nimbus Lab 
00003 
00004   Licensed under the Apache License, Version 2.0 (the "License");
00005      you may not use this file except in compliance with the License.
00006     You may obtain a copy of the License at
00007 
00008         http://www.apache.org/licenses/LICENSE-2.0
00009 
00010     Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013    See the License for the specific language governing permissions and
00014   limitations under the License.
00015  */
00016 package edu.nimbus.glass;
00017 
00018 import com.google.android.glass.app.Card;
00019 
00020 import android.app.Activity;
00021 import android.content.Intent;
00022 import android.os.Bundle;
00023 import android.util.Log;
00024 import android.view.View;
00025 
00026 
00033 public class StartServiceActivity extends Activity {
00034 
00035 
00036         @Override
00037         protected void onCreate(Bundle savedInstanceState) {
00038                 super.onCreate(savedInstanceState);
00039                 Log.d("Startup", "STARTING");
00040                 Intent intt = new Intent(this, ROSMonitorService.class);                
00041                 //kill the service if it is already running because we want to subscrive to a new topic.  
00042                 stopService(intt);
00043 
00044                 Card card1 = new Card(this);
00045                 card1.setText("Robot Warning Monitor");
00046 
00047                 View card1View = card1.toView();
00048 
00049                 // Display the card we just created
00050                 setContentView(card1View);
00051                 intt = new Intent(this, ROSMonitorService.class);       
00052                 startService(intt);
00053 
00054         }
00055 
00056 }


ros_glass_tools
Author(s):
autogenerated on Thu Aug 27 2015 14:47:21