[Solved] Error parsing XML: unbound prefix in activity_main xml file

Use -1dp instead of only -1 for example <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:customview=”http://schemas.android.com/apk/res-auto” android:background=”#000000″ android:layout_height=”-1dp” android:layout_width=”-1dp”> <WebView android:id=”@+id/webView1″ android:layout_alignParentBottom=”true” android:layout_alignParentLeft=”true” android:layout_height=”-1dp” android:layout_width=”-1dp” /> <ProgressBar android:id=”@+id/progressBar1″ android:layout_centerHorizontal=”true” android:layout_centerVertical=”true” android:layout_height=”-2dp” android:layout_width=”-2dp” /> <RelativeLayout android:id=”@+id/RlayBotm” android:layout_alignParentBottom=”true” android:layout_alignParentLeft=”true” android:layout_height=”40dp” android:layout_width=”-1dp”> <WebView android:id=”@+id/adsview” android:layout_centerHorizontal=”true” android:layout_centerVertical=”true” android:layout_height=”-1dp” android:layout_width=”-1dp” android:scrollbars=”0″ /> </RelativeLayout> <RelativeLayout android:id=”@+id/welcome” android:layout_alignParentRight=”true” android:layout_alignParentTop=”true” android:layout_height=”-1dp” android:layout_width=”-1dp”> <ImageView android:background=”#000000″ android:id=”@+id/img” … Read more

[Solved] How to read txt file, and use the double values in it?

You can try that code import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class MainActivity extends AppCompatActivity { AudioAnalyzer aa = new AudioAnalyzer(); TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView) findViewById(R.id.textView); } public void analyzer (View view) throws FileNotFoundException{ try { double[] input = … Read more

[Solved] Android Frebase User Data Retrieve [closed]

In your Database Reference make sure you are having the correct path to the data your are retrieving, like DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child(“your/path/to/data”); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { //making sure snapshot consists some data if (dataSnapshot.exists()) { //do your stuff User userDashboard = dataSnapshot.getValue(User.class); USERNAME.setText(userDashboard.getName().toString().trim()); PASSWORD.setText(userDashboard.getPassword().toString().trim()); EMAIL.setText(userDashboard.getEmail().toString().trim()); } } @Override … Read more

[Solved] How can i add two buttons to the listview from the adapter?

For ListViews, there are two layout files used. One specifies the layout for the list as a whole, the other specifies the layout for the list_item. List Item Layout: list_item.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:baselineAligned=”false” android:orientation=”horizontal”> <TextView android:id=”@+id/contact_phone” android:layout_width=”match_parent” android:layout_height=”40dp” android:layout_marginBottom=”2dp” android:layout_marginLeft=”5dp” android:layout_marginStart=”5dp” android:layout_marginRight=”5dp” android:layout_marginEnd=”5dp” android:layout_weight=”0.73″ android:background=”#00000000″ android:gravity=”start|center_vertical” android:text=”” android:textColor=”#FFFFFFFF” android:textSize=”16sp” /> … Read more

[Solved] Hello i have a issue with this example

You have to user Exifinterface and Matrix to get the right orientation. try this: public static void handleImageRotation(Context context, File mFileTemp) { if (!mFileTemp.exists()) { Toast.makeText(context, “File not found”, Toast.LENGTH_SHORT).show(); return; } ExifInterface exif = null; int orientation = ExifInterface.ORIENTATION_NORMAL; try { exif = new ExifInterface(mFileTemp.getAbsolutePath()); orientation = exif.getAttributeInt( ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); } catch (Exception e) … Read more

[Solved] How to reproduce this shape

Try this code: <RelativeLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_centerVertical=”true”> <TextView android:id=”@+id/tvText” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_centerInParent=”true” android:layout_marginLeft=”10dp” android:layout_marginRight=”10dp” android:text=”lala” android:textColor=”#FFFFFF”/> <View android:layout_width=”match_parent” android:layout_height=”1dp” android:layout_centerVertical=”true” android:layout_marginLeft=”16dp” android:layout_toLeftOf=”@id/tvText” android:background=”#FF0000″ /> <View android:layout_width=”match_parent” android:layout_height=”1dp” android:layout_centerVertical=”true” android:layout_marginRight=”16dp” android:layout_toRightOf=”@id/tvText” android:background=”#FF0000″ /> </RelativeLayout> solved How to reproduce this shape

[Solved] Firebase Error : Failed to resolve : com.google.firebase:firebase-database:16.0.6 [closed]

In order to add firebase-database to your application, you also need to add the firebase-core libraries (which you commented out). app/build.gradle dependencies { // … implementation ‘com.google.firebase:firebase-core:16.0.6′ } If you haven’t done so, you also need to add rules to include Google services and Google’s Maven repository. Please read Add Firebase to Your Android Project … Read more

[Solved] How to implement on click in cardview + recycler view with firebase?

please take a look at my snipshed code, in my case i use this way to implement setonlclick in recycleview item and send value to other activity holder.setName(userName); holder.setUserImage(userThumb, getContext()); holder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent chatIntent = new Intent(getContext(), Tampung_chatActivity.class); chatIntent.putExtra(“user_id”, list_user_id); chatIntent.putExtra(“user_name”, userName); startActivity(chatIntent); } }); full code you … Read more