Форум программистов, компьютерный форум, киберфорум
Программирование Android
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.69/16: Рейтинг темы: голосов - 16, средняя оценка - 4.69
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74

Ошибка при создании приложения под Android

17.07.2013, 15:07. Показов 3332. Ответов 13
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте, уже неделю не пойму как исправить несколько ошибок в коде. Изучать стал недавно, поэтому еще очень тяжело...
первая ошибка в 29 строке кода ниже... подчеркивает confirmMessage (ошибка confirmMessage cannot be resolved or is not a field)
Кликните здесь для просмотра всего текста
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    public OnClickListener ClearTagsButtonListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
            //создание нового AlertDialog Builder
            AlertDialog.Builder builder = new AlertDialog.Builder(Twitter.this);
            
            builder.setTitle(R.string.confirmTitle); //строка заголовка
            
            //кнопка ОК, которая скрывает диалоговое окно
            builder.setPositiveButton(R.string.erase, 
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int button) {
                            clearButtons(); //очистка сохраненных поисков из карты
                    
                            //SharedPreferences.Editor для очистки поисков
                            android.content.SharedPreferences.Editor preferencesEditor = 
                                    savedSearches.edit();
                    
                            preferencesEditor.clear(); //удаление пар тег/запрос
                            preferencesEditor.apply(); //подтверждение изменений
                        } //конец метода onClick
                    } //конец ононимного внутреннего класса
                    ); //конец вызова метода setPositiveButton
                builder.setCancelable(true);
                builder.setNegativeButton(R.string.cancel, null);
                
                //настройка отображаемого сообщения
                builder.setMessage(R.string.confirmMessage);
                
                //создание диалогового окна AlertDialog из AlertDialog.Builder
                AlertDialog confirmDialog = builder.create();
                confirmDialog.show(); //отображение диалогового окна
            } //конец метода onClick
    }; //конец анонимного внутреннего класса OnClickListener


вторая ошибка в строке 7 кода ниже... подчеркивает buttonTableRow (ошибка The local variable buttonTableRow may not have been initialized)
Кликните здесь для просмотра всего текста
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public OnClickListener editButtonListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
            //получение всех необходимых компонентов GUI
            TableRow buttonRow = (TableRow) v.getParent();
            Activity buttonTableRow;
            Button searchButton = (Button) buttonTableRow.findViewById(R.id.newTagButton);
                        
            String tag = searchButton.getText().toString();
            
            //EditTexts должны соответствовать выбранному тегу и запросу
            tagEditText.setTag(tag);
            Context saveSearches;
            //queryEditText.setText(savedSearches.getString(tag, ""));
            queryEditText.setText(savedSearches.getString(tag, null));
        } //конец метода onClick
    }; //конец анонимного внутреннего класса OnClickListener


третья ошибка в строке 17 кода ниже... подчеркивает refreshButtons (ошибка The method refreshButtons(null) is undefined for the type Twitter)
Кликните здесь для просмотра всего текста
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); //вызов версии суперкласса
        setContentView(R.layout.main); //настройка макета
        //сохраненные поисковые запросы пользователя
        savedSearches = getSharedPreferences("searches", MODE_PRIVATE);
        //получение ссылки на queryTableLayout
        queryTableLayout = (TableLayout) findViewById(R.id.queryTableLayout);
        //получение ссылок на EditText и кнопку Save
        queryEditText = (EditText) findViewById(R.id.queryEditText);
        tagEditText = (EditText) findViewById(R.id.tagEditText);
        //регистрация слушателей (?) для кнопок Save u Clear Tags
        Button saveButton = (Button) findViewById(R.id.saveButton);
        saveButton.setOnClickListener(saveButtonListener);
        Button clearTagsButton = (Button) findViewById(R.id.clearTagsButton);
        clearTagsButton.setOnClickListener(ClearTagsButtonListener);
        
        refreshButtons(null); //добавление ранее сохраненных поисковых запросов в GUI
                
    } //конец метода onCreate


файл R.java В строках 58 и 59 неправильно определяет переменную и не получается это исправить... исправив это, исчезнет первая ошибка... но как я не знаю...
Кликните здесь для просмотра всего текста
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */
 
package com.sergey.twitter;
 
public final class R {
    public static final class attr {
        /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
         */
        public static final int buttonBarButtonStyle=0x7f010001;
        /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
         */
        public static final int buttonBarStyle=0x7f010000;
    }
    public static final class color {
        public static final int light_orange=0x7f040000;
    }
    public static final class dimen {
        public static final int editButtonWidth=0x7f050001;
        public static final int tagButtonWidth=0x7f050000;
    }
    public static final class drawable {
        public static final int ic_launcher=0x7f020000;
    }
    public static final class id {
        public static final int TableLayout=0x7f080000;
        public static final int clearTagsButton=0x7f08000c;
        public static final int newEditButton=0x7f08000f;
        public static final int newTagButton=0x7f08000e;
        public static final int newTagTableRow=0x7f08000d;
        public static final int queryEditText=0x7f080002;
        public static final int queryScrollView=0x7f080009;
        public static final int queryTableLayout=0x7f08000a;
        public static final int saveButton=0x7f080005;
        public static final int tableRow0=0x7f080001;
        public static final int tableRow1=0x7f080003;
        public static final int tableRow2=0x7f080006;
        public static final int tableRow3=0x7f080008;
        public static final int tableRow4=0x7f08000b;
        public static final int tagEditText=0x7f080004;
        public static final int taggedSearchesTextView=0x7f080007;
    }
    public static final class layout {
        public static final int main=0x7f030000;
        public static final int new_tag_view=0x7f030001;
    }
    public static final class string {
        public static final int OK=0x7f06000c;
        public static final int app_name=0x7f060002;
        public static final int cancel=0x7f06000b;
        public static final int clearTags=0x7f060008;
        public static final int conп¬ЃrmMessage=0x7f060010;
        public static final int conп¬ЃrmTitle=0x7f06000f;
        public static final int dummy_button=0x7f060000;
        public static final int dummy_content=0x7f060001;
        public static final int edit=0x7f060007;
        public static final int erase=0x7f06000a;
        public static final int missingMessage=0x7f06000e;
        public static final int missingTitle=0x7f06000d;
        public static final int queryPrompt=0x7f060005;
        public static final int save=0x7f060009;
        public static final int searchURL=0x7f060003;
        public static final int tagPrompt=0x7f060004;
        public static final int taggedSearches=0x7f060006;
    }
    public static final class style {
        /** 
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
 
    
 
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
 
        
 
        Base application theme for API 11+. This theme completely replaces
        AppBaseTheme from res/values/styles.xml on API 11+ devices.
 
    
 API 11 theme customizations can go here. 
 
        Base application theme for API 14+. This theme completely replaces
        AppBaseTheme from BOTH res/values/styles.xml and
        res/values-v11/styles.xml on API 14+ devices.
    
 API 14 theme customizations can go here. 
         */
        public static final int AppBaseTheme=0x7f070000;
        /**  Application theme. 
 All customizations that are NOT specific to a particular API-level can go here. 
         */
        public static final int AppTheme=0x7f070001;
        public static final int ButtonBar=0x7f070003;
        public static final int ButtonBarButton=0x7f070004;
        public static final int FullscreenActionBarStyle=0x7f070005;
        public static final int FullscreenTheme=0x7f070002;
    }
    public static final class styleable {
        /** 
         Declare custom theme attributes that allow changing which styles are
         used for button bars depending on the API level.
         ?android:attr/buttonBarStyle is new as of API 11 so this is
         necessary to support previous API levels.
    
           <p>Includes the following attributes:</p>
           <table>
           <colgroup align="left" />
           <colgroup align="left" />
           <tr><th>Attribute</th><th>Description</th></tr>
           <tr><td><code>{@link #ButtonBarContainerTheme_buttonBarButtonStyle com.sergey.twitter:buttonBarButtonStyle}</code></td><td></td></tr>
           <tr><td><code>{@link #ButtonBarContainerTheme_buttonBarStyle com.sergey.twitter:buttonBarStyle}</code></td><td></td></tr>
           </table>
           @see #ButtonBarContainerTheme_buttonBarButtonStyle
           @see #ButtonBarContainerTheme_buttonBarStyle
         */
        public static final int[] ButtonBarContainerTheme = {
            0x7f010000, 0x7f010001
        };
        /**
          <p>This symbol is the offset where the {@link com.sergey.twitter.R.attr#buttonBarButtonStyle}
          attribute's value can be found in the {@link #ButtonBarContainerTheme} array.
 
 
          <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
          @attr name android:buttonBarButtonStyle
        */
        public static final int ButtonBarContainerTheme_buttonBarButtonStyle = 1;
        /**
          <p>This symbol is the offset where the {@link com.sergey.twitter.R.attr#buttonBarStyle}
          attribute's value can be found in the {@link #ButtonBarContainerTheme} array.
 
 
          <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
          @attr name android:buttonBarStyle
        */
        public static final int ButtonBarContainerTheme_buttonBarStyle = 0;
    };
}


Прикрепил скрин со всеми ошибками... хоть их там по сути и много, но большинство являются следствием первой ошибки в данной теме... исправив ее - смогу исправить большинство других...
Может быть нужны какие-то еще файлы, если надо я скину
0
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
17.07.2013, 15:07
Ответы с готовыми решениями:

Почта под Android: выбрасывается исключение при создании объекта класса URLName
Всем доброго времени суток. Помогите, плз, разобраться с почтой. Моя программа под Андроид должна лезть на почту, забирать оттуда файлы и...

Ошибка при создании проекта в Android Studio
При создание нового проекта , в режиме выбора названия проекта выдает данную ошибку you project location contains non-ascii characters. Как...

Ошибка при создании приложения
Решил научиться работать в Android Studio. Установил её, запустил, решил запустить простейшее приложение с выводом &quot;Hello...

13
106 / 106 / 1
Регистрация: 09.04.2012
Сообщений: 655
17.07.2013, 15:21
Цитата Сообщение от TAMEPJlAH Посмотреть сообщение
файл R.java В строках 58 и 59 неправильно определяет переменную и не получается это исправить... исправив это, исчезнет первая ошибка... но как я не знаю...
Вы прям в R.java вручную меняете?

Добавлено через 2 минуты
Цитата Сообщение от TAMEPJlAH Посмотреть сообщение
//создание диалогового окна AlertDialog из AlertDialog.Builder
* * * * * * * * AlertDialog confirmDialog = builder.create();
* * * * * * * * confirmDialog.show(); //отображение диалогового окна
Какое это окно показывает? Может нужно
Java
1
 builder.show();
0
 Аватар для chizz
993 / 521 / 102
Регистрация: 19.03.2013
Сообщений: 3,114
Записей в блоге: 19
17.07.2013, 16:00
1.
confirmMessage cannot be resolved or is not a field.
Значит нет в strings.xml строки confirmMessage. Добавьте в strings.xml confirmMessage

2. Activity buttonTableRow;
Button searchButton = (Button) buttonTableRow.findViewById(R.id.newTagB utton);

У вас получается новый buttonTableRow, который никак не инициирован и ни на что не указывает.
Button searchButton = (Button) this.findViewById(R.id.newTagButton);
или
Button searchButton = (Button) нужная_активити.this.findViewById(R.id.n ewTagButton);

3. В классе отсутствует метод refreshButtons
4. На всякий: R.java можно перегенерировать, удалив полностью раздел generated.
1
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74
17.07.2013, 18:11  [ТС]
Цитата Сообщение от Digetix Посмотреть сообщение
Вы прям в R.java вручную меняете?
Вручную в R.java если пытаться изменить, то он сперва спрашивает "This file is derived. Do you really want to edit it?" при нажатии Yes изменять можно, но при сохранении все возвращается обратно...

Цитата Сообщение от Digetix Посмотреть сообщение
Какое это окно показывает? Может нужно
Java
1
 builder.show();
на данной строчке ошибку не показывает, изменил как вы посоветовали, но ни одна ошибка не исчезла...

Цитата Сообщение от chizz Посмотреть сообщение
1. confirmMessage cannot be resolved or is not a field.
Значит нет в strings.xml строки confirmMessage. Добавьте в strings.xml confirmMessage
Строчка была, но confirmMessage был записан как-то некорректно, исправил, спасибо

Цитата Сообщение от chizz Посмотреть сообщение
2. Activity buttonTableRow;
Button searchButton = (Button) buttonTableRow.findViewById(R.id.newTagB utton);
У вас получается новый buttonTableRow, который никак не инициирован и ни на что не указывает.
Button searchButton = (Button) this.findViewById(R.id.newTagButton);
или
Button searchButton = (Button) нужная_активити.this.findViewById(R.id.n ewTagButton);
исправил, заработало вроде-бы

Цитата Сообщение от chizz Посмотреть сообщение
3. В классе отсутствует метод refreshButtons
забыл в названии метода последнюю буковку, был метод refreshButton

Цитата Сообщение от chizz Посмотреть сообщение
4. На всякий: R.java можно перегенерировать, удалив полностью раздел generated.
непонадобилось...
0
106 / 106 / 1
Регистрация: 09.04.2012
Сообщений: 655
17.07.2013, 18:15
Цитата Сообщение от TAMEPJlAH Посмотреть сообщение
Вручную в R.java если пытаться изменить, то он сперва спрашивает "This file is derived. Do you really want to edit it?" при нажатии Yes изменять можно, но при сохранении все возвращается обратно...
Потому что его вручную не меняют, он автоматом генерируется
0
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74
17.07.2013, 18:22  [ТС]
теперь при запуске в эмуляторе показывает ошибку (на скрине), а в LogCat выдает почти все красным, кроме первых двух и последней строк:
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
07-04 11:15:21.409: D/AndroidRuntime(915): Shutting down VM
 
07-04 11:15:21.409: W/dalvikvm(915): threadid=1: thread exiting with uncaught exception (group=0x40015560)
 
07-04 11:15:21.428: E/AndroidRuntime(915): FATAL EXCEPTION: main
 
07-04 11:15:21.428: E/AndroidRuntime(915): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sergey.twitter/com.sergey.twitter.Twitter}: java.lang.ClassCastException: android.widget.LinearLayout
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.os.Handler.dispatchMessage(Handler.java:99)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.os.Looper.loop(Looper.java:123)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.ActivityThread.main(ActivityThread.java:3683)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at java.lang.reflect.Method.invokeNative(Native Method)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at java.lang.reflect.Method.invoke(Method.java:507)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at dalvik.system.NativeStart.main(Native Method)
 
07-04 11:15:21.428: E/AndroidRuntime(915): Caused by: java.lang.ClassCastException: android.widget.LinearLayout
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at com.sergey.twitter.Twitter.onCreate(Twitter.java:50)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
 
07-04 11:15:21.428: E/AndroidRuntime(915):  ... 11 more
 
07-04 11:20:21.493: I/Process(915): Sending signal. PID: 915 SIG: 9
Миниатюры
Ошибка при создании приложения под Android  
0
 Аватар для chizz
993 / 521 / 102
Регистрация: 19.03.2013
Сообщений: 3,114
Записей в блоге: 19
18.07.2013, 10:03
Пройдись дебаггером, может LogCat что поинформативней покажет.
0
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74
19.07.2013, 09:11  [ТС]
дебаггер ничего нового не показывает
0
1162 / 986 / 1
Регистрация: 28.06.2012
Сообщений: 3,462
19.07.2013, 11:11
Цитата Сообщение от TAMEPJlAH Посмотреть сообщение
com.sergey.twitter.Twitter.onCreate(Twit ter.java:50)
и что в 50-ой строке написано?
0
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74
19.07.2013, 11:15  [ТС]
Цитата Сообщение от V0v1k Посмотреть сообщение
и что в 50-ой строке написано?
Java
1
queryTableLayout = (TableLayout) findViewById(R.id.queryTableLayout);
Весь метод onCreate (10я стока)
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); //вызов версии суперкласса
        setContentView(R.layout.main); //настройка макета
        //сохраненные поисковые запросы пользователя
        savedSearches = getSharedPreferences("searches", MODE_PRIVATE);
        //получение ссылки на queryTableLayout
        queryTableLayout = (TableLayout) findViewById(R.id.queryTableLayout);
        //получение ссылок на EditText и кнопку Save
        queryEditText = (EditText) findViewById(R.id.queryEditText);
        tagEditText = (EditText) findViewById(R.id.tagEditText);
        //регистрация слушателей (?) для кнопок Save u Clear Tags
        Button saveButton = (Button) findViewById(R.id.saveButton);
        saveButton.setOnClickListener(saveButtonListener);
        Button clearTagsButton = (Button) findViewById(R.id.clearTagsButton);
        clearTagsButton.setOnClickListener(ClearTagsButtonListener);
        
        refreshButtons(null); //добавление ранее сохраненных поисковых запросов в GUI
                
    } //конец метода onCreate
0
1162 / 986 / 1
Регистрация: 28.06.2012
Сообщений: 3,462
19.07.2013, 11:16
а теперь покажите лаяут main.
0
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74
19.07.2013, 11:18  [ТС]
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/TableLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    android:padding="5dp"
    android:shrinkColumns="*"
    tools:context=".Twitter" >
 
    <TableRow
        android:id="@+id/tableRow0"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
 
        <EditText
            android:id="@+id/queryEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_span="2"
            android:ems="10"
            android:hint="@string/queryPrompt"
            android:imeOptions="actionNext"
            android:inputType="text" >
 
            <requestFocus />
        </EditText>
 
    </TableRow>
 
    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
 
        <EditText
            android:id="@+id/tagEditText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:ems="10"
            android:hint="@string/tagPrompt"
            android:imeOptions="actionDone"
            android:inputType="text" />
 
        <Button
            android:id="@+id/saveButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="@string/save" />
 
    </TableRow>
 
    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/light_orange" >
 
        <TextView
            android:id="@+id/taggedSearchesTextView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_span="2"
            android:padding="5dp"
            android:text="@string/taggedSearches"
            android:textColor="@android:color/black"
            android:textSize="18sp" />
 
    </TableRow>
 
    <TableRow
        android:id="@+id/tableRow3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/light_orange"
        android:layout_weight="1" >
 
        <ScrollView
            android:id="@+id/queryScrollView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_span="2"
            android:padding="5dp" >
 
            <LinearLayout
                android:id="@+id/queryTableLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:padding="5dp"
                android:stretchColumns="*" >
 
            </LinearLayout>
        </ScrollView>
 
    </TableRow>
 
    <TableRow
        android:id="@+id/tableRow4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
 
        <Button
            android:id="@+id/clearTagsButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:layout_span="2"
            android:text="@string/clearTags" />
 
    </TableRow>
 
</TableLayout>
0
1162 / 986 / 1
Регистрация: 28.06.2012
Сообщений: 3,462
19.07.2013, 11:21
Цитата Сообщение от TAMEPJlAH Посмотреть сообщение
Java
1
queryTableLayout = (TableLayout) findViewById(R.id.queryTableLayout);
Цитата Сообщение от TAMEPJlAH Посмотреть сообщение
<LinearLayout
android:id="@+id/queryTableLayout"
и что мы здесь видим?
1
1 / 1 / 1
Регистрация: 02.05.2010
Сообщений: 74
19.07.2013, 12:04  [ТС]
Цитата Сообщение от V0v1k Посмотреть сообщение
и что мы здесь видим?
queryTableLayout имеет тип LinearLayout, а надо TableLayout. Спасибо, все заработало Вроде бы менял тип, но почему-то несохранилось с меня плюсик
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
19.07.2013, 12:04
Помогаю со студенческими работами здесь

При создании проекта в android studio 3.3 возникла ошибка
При создании проекта в android studio 3.3 возникла ошибка. Что делать?

Ошибка при установке приложения Android
Создана и протестированна программа eclipse+SDK. В AVD все работает. Таргет версия 4,0,0. При установке на планшет apk файла, версия...

Ошибка при создание приложения на Android
Делаю первое приложения в Netbias, вот такая ошибка при создание проекта

Дизайн приложения под Android в Photoshop
Всем доброго времени суток! Помогите разобраться, нарисовал я дизайн приложения в фотошопе а вот как его потом порезать и засунуть в...

Перенос приложения из Windows под Android
требуется написание проги под андроид, которая есть в windows. уточняю: есть прога на винде самописанная, она написана на дэльфи, и...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
14
Ответ Создать тему
Новые блоги и статьи
SDL3 для Web (WebAssembly): Реализация движения на Box2D v3 - трение и коллизии с повёрнутыми стенами
8Observer8 20.02.2026
Содержание блога Box2D позволяет легко создать главного героя, который не проходит сквозь стены и перемещается с заданным трением о препятствия, которые можно располагать под углом, как верхнее. . .
Конвертировать закладки radiotray-ng в m3u-плейлист
damix 19.02.2026
Это можно сделать скриптом для PowerShell. Использование . \СonvertRadiotrayToM3U. ps1 <path_to_bookmarks. json> Рядом с файлом bookmarks. json появится файл bookmarks. m3u с результатом. # Check if. . .
Семь CDC на одном интерфейсе: 5 U[S]ARTов, 1 CAN и 1 SSI
Eddy_Em 18.02.2026
Постепенно допиливаю свою "многоинтерфейсную плату". Выглядит вот так: https:/ / www. cyberforum. ru/ blog_attachment. php?attachmentid=11617&stc=1&d=1771445347 Основана на STM32F303RBT6. На борту пять. . .
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу, и светлой Луне. В мире покоя нет и люди не могут жить в тишине. А жить им немного лет.
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила» «Время-Деньги» «Деньги -Пуля»
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru