android-inflate

trouble accessing inflated ratingBar in Android

江枫思渺然 提交于 2019-12-13 06:27:16
问题 I have an async task that check if a user has a certain item, by checking a database. If they have an item then I inflate a rating bar, if not I inflate a button so they can add the item. I inflate the rating bar in an class which extends asyncTask with: //inflate star rater LayoutInflater mInflater = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LinearLayout addButton = (LinearLayout)((Activity) c).findViewById(R.id.addBeerLayout); addButton.addView(mInflater.inflate(R

Is it possible to dynamically add AndroidAnnotation @EViewGroups instead of using the traditional inflate directly?

不打扰是莪最后的温柔 提交于 2019-12-13 06:19:01
问题 I'm trying to use Android Annotations and dynamically add layout components when my createNewRow button is clicked. The app runs and displays the default rows defined in activity_main.xml and, after clicking createNewButton I see children attached to my dynamicTable in the debugger but the new children are not displayed. Here is my main activity XML: activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

Inflating custom View in ListView according to position

醉酒当歌 提交于 2019-12-13 04:29:10
问题 I have a ListView where I would like to inflate a custom View at a certain position. It's actually the 11th item (position 10). The getCount() method returns 11. Here is the top part of the getView() method: public View getView(final int position, View convertView, ViewGroup parent) { final ViewHolder holder; if (convertView == null) { if (position < 10) { convertView = mInflater.inflate(R.layout.standard, null); } else { convertView = mInflater.inflate(R.layout.custom, null); Log.i(TAG,

android - adding views is too slow

有些话、适合烂在心里 提交于 2019-12-13 00:51:07
问题 I need to add about 10 views to ScrollView and I use the following code final LinearLayout item_div = (LinearLayout)activity.findViewById(R.id.item_div); final LayoutInflater inflater = (LayoutInflater)context.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); for (int i = 0; i < itemArray.length(); i++) { View itemTemplate = inflater.inflate(R.layout.item, null); item_div.addView(itemTemplate); } but the problem is that this process take about 1-2 seconds and it

Android while using cardview image is loading very lazy

时光总嘲笑我的痴心妄想 提交于 2019-12-12 08:16:20
问题 I am loading pictures (below ~3MB in size) into Cardview from a database and it was infalte in Listviewstview. The loading and browsing of these pictures is way too slow. Is there any method to downscale these pictures to speed up & sometimes dispalyind [Duplicate] images on other card view? cardview xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

Creating more than one TableLayout in the same layout

爷,独闯天下 提交于 2019-12-12 04:53:13
问题 I have a need to create more than one TableLayout with a varied number of rows in one XML layout. In my main layout I have an empty LinearLayout, as shown below: <LinearLayout android:id="@+id/resultsLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> </LinearLayout> I declare this in my activity as so: private LinearLayout linearResultsLayout; linearResultsLayout = (LinearLayout) findViewById(R.id.resultsLayout); I have added a

Binary XML file line #53: Error inflating class ImageView

吃可爱长大的小学妹 提交于 2019-12-12 02:42:15
问题 I build my app against minSdkVersion 11 targetSdkVersion 23 When I run it on Samsug Galaxy S5 or Note5, the app runs fine with no problem. But when I try to run it on a Samsung S3 running android 4.4.2, it crashes with the following stack trace. I already read android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>. Does my stack trace shed some particular light so that someone can help me further? Also the reference to line 153 in MainActivity is simply

Getting error inflating CardView despite of using last version

旧时模样 提交于 2019-12-11 22:08:19
问题 I have a problem which is wasting my time. I was working on my project very well until yesterday. When I started to work last morning I have faced this problem ; "Binary XML file line #2: Error inflating class android.support.v7.widget.CardView" I have suddennly googled and I have seen that some other people faced either. But answers about these problem is not my solution. It hasnt fixed my problem. Pls save my day :) here is my gradle ; dependencies { implementation fileTree(include: ['*.jar

Refreshing For Constant Fragments

£可爱£侵袭症+ 提交于 2019-12-11 17:13:20
问题 I will try to describe the problem and simplify it At my app, I have one activity, and 3 fragments and I swap through them at Phone Mode. and these fragments I made their fragments instances as constant objects at main activity so the internal objects which are not related to fragment life cycle stay hold their values even this fragment doesn't visible (Logically the objects will release when the fragment object is destroyed) Now, when I tried to make my app support tablet, I made the 3

Error inflating class switch, ActionBarSherlock (InflateException)

自古美人都是妖i 提交于 2019-12-11 08:22:47
问题 I'm running into a pain of an error. I have a SherlockFragmentActivity, and at least two SherlockFragments. Both use onCreateView to inflate an xml file. LoginFragment, however, has a switch widget: econ fragment does not. If I add a switch widget into econfragment.xml, that causes a crash of the same type (while loginfragment is commented out of implementation). If I remove the switch widget from loginfragment, a similar error shows up for RadioGroup - but econfragment already has a radio