MainActivity.java revision 185a7e38bc58abd341445ef9acdec9a4722a6946
1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * 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, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16package com.android.multidexlegacytestapp;
17
18import android.app.Activity;
19import android.os.Bundle;
20import android.support.multidex.MultiDex;
21import android.util.Log;
22import android.widget.TextView;
23
24public class MainActivity extends Activity {
25
26    private static final String TAG = "MultidexLegacyTestApp";
27    private int instanceFieldNotInited;
28    private int instanceFieldInited =
29            new com.android.multidexlegacytestapp.manymethods.Big043().get43();
30    private static int staticField =
31            new com.android.multidexlegacytestapp.manymethods.Big044().get44();
32
33    public MainActivity() {
34        instanceFieldNotInited = new com.android.multidexlegacytestapp.manymethods.Big042().get42();
35    }
36
37    @Override
38    protected void onCreate(Bundle savedInstanceState) {
39        Log.i(TAG, "onCreate");
40        MultiDex.install(getApplicationContext());
41        Log.i(TAG, "Multi dex installation done.");
42        super.onCreate(savedInstanceState);
43        setContentView(R.layout.activity_main);
44        int value = getValue();
45        ((TextView) findViewById(R.id.label_nb)).setText("Here's the count " + value);
46
47        Log.i(TAG, "Here's the count " + value);
48    }
49
50    public int getValue() {
51        int value = new com.android.multidexlegacytestapp.manymethods.Big001().get1()
52                + new com.android.multidexlegacytestapp.manymethods.Big002().get2()
53                + new com.android.multidexlegacytestapp.manymethods.Big003().get3()
54                + new com.android.multidexlegacytestapp.manymethods.Big004().get4()
55                + new com.android.multidexlegacytestapp.manymethods.Big005().get5()
56                + new com.android.multidexlegacytestapp.manymethods.Big006().get6()
57                + new com.android.multidexlegacytestapp.manymethods.Big007().get7()
58                + new com.android.multidexlegacytestapp.manymethods.Big008().get8()
59                + new com.android.multidexlegacytestapp.manymethods.Big009().get9()
60                + new com.android.multidexlegacytestapp.manymethods.Big010().get10()
61                + new com.android.multidexlegacytestapp.manymethods.Big011().get11()
62                + new com.android.multidexlegacytestapp.manymethods.Big012().get12()
63                + new com.android.multidexlegacytestapp.manymethods.Big013().get13()
64                + new com.android.multidexlegacytestapp.manymethods.Big014().get14()
65                + new com.android.multidexlegacytestapp.manymethods.Big015().get15()
66                + new com.android.multidexlegacytestapp.manymethods.Big016().get16()
67                + new com.android.multidexlegacytestapp.manymethods.Big017().get17()
68                + new com.android.multidexlegacytestapp.manymethods.Big018().get18()
69                + new com.android.multidexlegacytestapp.manymethods.Big019().get19()
70                + new com.android.multidexlegacytestapp.manymethods.Big020().get20()
71                + new com.android.multidexlegacytestapp.manymethods.Big021().get21()
72                + new com.android.multidexlegacytestapp.manymethods.Big022().get22()
73                + new com.android.multidexlegacytestapp.manymethods.Big023().get23()
74                + new com.android.multidexlegacytestapp.manymethods.Big024().get24()
75                + new com.android.multidexlegacytestapp.manymethods.Big025().get25()
76                + new com.android.multidexlegacytestapp.manymethods.Big026().get26()
77                + new com.android.multidexlegacytestapp.manymethods.Big027().get27()
78                + new com.android.multidexlegacytestapp.manymethods.Big028().get28()
79                + new com.android.multidexlegacytestapp.manymethods.Big029().get29()
80                + new com.android.multidexlegacytestapp.manymethods.Big030().get30()
81                + new com.android.multidexlegacytestapp.manymethods.Big031().get31()
82                + new com.android.multidexlegacytestapp.manymethods.Big032().get32()
83                + new com.android.multidexlegacytestapp.manymethods.Big033().get33()
84                + new com.android.multidexlegacytestapp.manymethods.Big034().get34()
85                + new com.android.multidexlegacytestapp.manymethods.Big035().get35()
86                + new com.android.multidexlegacytestapp.manymethods.Big036().get36()
87                + new com.android.multidexlegacytestapp.manymethods.Big037().get37()
88                + new com.android.multidexlegacytestapp.manymethods.Big038().get38()
89                + new com.android.multidexlegacytestapp.manymethods.Big039().get39()
90                + new com.android.multidexlegacytestapp.manymethods.Big040().get40()
91                + new com.android.multidexlegacytestapp.manymethods.Big041().get41()
92                + instanceFieldNotInited + instanceFieldInited + staticField
93                + IntermediateClass.get() + Referenced.get(instanceFieldNotInited);
94        return value;
95    }
96
97}
98