UsbAccessoryActivity.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 The Android Open Source Project
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 
00017 package org.ros.rosserial;
00018 
00019 import android.app.Activity;
00020 import android.content.ActivityNotFoundException;
00021 import android.content.Intent;
00022 import android.os.Bundle;
00023 import android.util.Log;
00024 
00025 /* This Activity does nothing but receive USB_DEVICE_ATTACHED events from the
00026  * USB service and springboards to the main launcher activity
00027  */
00028 public final class UsbAccessoryActivity extends Activity {
00029 
00030         static final String TAG = "UsbAccessoryActivity";
00031 
00032         @Override
00033         protected void onCreate(Bundle savedInstanceState) {
00034                 super.onCreate(savedInstanceState);
00035 
00036                 Intent intent = new Intent(this,org.ros.rosserial.RosserialLauncherActivity.class);
00037                 
00038                 
00039                 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
00040                                 | Intent.FLAG_ACTIVITY_CLEAR_TOP);
00041                 try {
00042                         startActivity(intent);
00043                 } catch (ActivityNotFoundException e) {
00044                         Log.e(TAG, "unable to start Rosserial Launcher activity", e);
00045                 }
00046                 finish();
00047         }
00048 }


rosserial_android
Author(s): Adam Stambler
autogenerated on Mon Dec 2 2013 12:02:05