1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.widget.focus;
18
19import com.android.frameworks.coretests.R;
20
21import android.app.Activity;
22import android.os.Bundle;
23import android.os.Handler;
24import android.widget.Button;
25
26/**
27 * Exercises cases where elements of the UI are requestFocus()ed.
28 */
29public class RequestFocus extends Activity {
30    protected final Handler mHandler = new Handler();
31
32    @Override protected void onCreate(Bundle icicle) {
33        super.onCreate(icicle);
34        setContentView(R.layout.focus_after_removal);
35
36        // bottom right button starts with the focus.
37        final Button bottomRightButton = (Button) findViewById(R.id.bottomRightButton);
38        bottomRightButton.requestFocus();
39        bottomRightButton.setText("I should have focus");
40    }
41
42    public Handler getHandler() {
43        return mHandler;
44    }
45}
46