android – Dynamically add TableRow to TableLayout-ThrowExceptions

Exception or error: When a button is clicked, the following method is run: public void createTableRow(View v) { TableLayout tl = (TableLayout) findViewById(R.id.spreadsheet); TableRow tr = new TableRow(this); LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); tr.setLayoutParams(lp); TextView tvLeft = new TextView(this); tvLeft.setLayoutParams(lp); tvLeft.setBackgroundColor(Color.WHITE); tvLeft.setText(“OMG”); TextView tvCenter = new TextView(this); tvCenter.setLayoutParams(lp); tvCenter.setBackgroundColor(Color.WHITE); tvCenter.setText(“It”); TextView tvRight = new …

layout – Android custom RatingBar image artifacts-ThrowExceptions

Exception or error: I implemented a custom RatingBar in an application on my ListView items. Custom style ratingbar_red.xml: <?xml version=”1.0″ encoding=”UTF-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@android:id/background” android:drawable=”@drawable/star_off” /> <item android:id=”@android:id/secondaryProgress” android:drawable=”@drawable/star_on” /> <item android:id=”@android:id/progress” android:drawable=”@drawable/star_on” /> </layer-list> Here’s part of ListItem layout: <LinearLayout android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:orientation=”horizontal” android:paddingLeft=”15dp” > <RatingBar android:id=”@+id/li_company_rating” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginTop=”15dp” android:layout_marginBottom=”1dp” android:isIndicator=”true” android:numStars=”5″ …

Android ProgressBar UI custom layout-ThrowExceptions

Exception or error: I am trying to customize a status bar so it will look like this image: However, after a good couple of hours all I have is a status bar with the background I need only (Image 2): The current code I have is: xml layout: <ProgressBar android:id=”@+id/pBarOverallStatus” style=”?android:attr/progressBarStyleHorizontal” android:layout_width=”0dip” android:layout_height=”fill_parent” android:layout_marginLeft=”10dip” android:layout_marginRight=”10dip” …

RelativeLayout "Couldn't resolve resource…" Android-ThrowExceptions

Exception or error: When using the below code, I get an error “Couldn’t resolve resource @id/item1” Why is this? id/item1 is added before I use it, so I’m not sure why this is coming up. <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:orientation=”vertical” > <ImageView android:id=”@+id/item1″ android:layout_width=”50dip” android:layout_height=”50dip” android:src=”@drawable/noimage” /> <TextView android:id=”@+id/item2″ android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text=”Title” …

android – Constraint layout Layout Crashing : All Children of constraint layout should have ids to use constraint set-ThrowExceptions

Exception or error: After updating to com.android.support.constraint:constraint-layout:1.1.0 The constraint layout crashes saying: All children of constraint layout should have ids to use constraint set I have set ids to all views even then it’s crashing. java.lang.RuntimeException: All children of ConstraintLayout must have ids to use ConstraintSet at android.support.constraint.ConstraintSet.clone(ConstraintSet.java:687) at com.zoho.notebook.views.SettingsViewNavBar.showNoteSettingsView(SettingsViewNavBar.java:594) at com.zoho.notebook.views.SettingsViewNavBar.onClick(SettingsViewNavBar.java:303) This problem is …