Posts by Edson Reis • 624 points
39 posts
-
0
votes1
answer677
viewsA: Convert URI to Bitmap
Uri imageUri = data.getData(); Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageUri); ByteArrayOutputStream byteArrayOutputStream = new…
-
0
votes2
answers709
viewsA: How do I place the image next to the listview items?
To add an image, you need to create a custom cell, use the concept of Recyclerview + Viewholder: In your Activity create Adapter by passing your list: @Override protected void onCreate(Bundle…
-
0
votes1
answer746
viewsA: How to load an image from a Url into an Imageview
Use the library Glide, follows the example of how to implement in the code: Glide.with(this) .load(urlImages.get("SUA URL")) .asBitmap() .listener(new RequestListener<String, Bitmap>() {…
-
2
votes1
answer280
viewsA: Check the app version on Google play
The most practical way is to create an API that you arrow the latest version of your app, within the app you make the check if the response of the api is smaller or equal to the current version,…
-
0
votes1
answer69
viewsA: Remove word accentuation in searchView
Try this public static String stripAccents(String s) { s = Normalizer.normalize(s, Normalizer.Form.NFD); s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return s; }…
-
1
votes1
answer353
viewsQ: What are and what are the main differences between Functional Programming and Reactive Programming?
I wanted a clear and objective explanation? I read separate cases, but I wanted to know the main points that differentiate the two
-
2
votes1
answer126
viewsA: Shuffle List
.sort() serves to sort a list, use .shuffle() to "shuffle".
-
1
votes1
answer67
viewsA: How to stop a for via external loop interference?
boolean keepGoing = true; for (int i = 0; i < codigo.size(); i++) { if (keepGoing) { i++; } else { return; } } void onClick(view v){ …
-
0
votes1
answer112
viewsA: Sign in Textview - Android
<TextView android:id="@+id/scrollingText" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="40dp" android:text="Texto aqui" …
-
0
votes1
answer621
viewsA: How to Load an Activity using Progressbar
Progressbar is an element of the user interface that indicates the progress of an operation, in this action you are doing there is no action that needs Progressbar. An example where you can use…
-
-1
votes1
answer476
viewsA: How to open a PDF file, which is in the Assets of my APP, in a PDF reader already installed on mobile phone?
Switch your PDF level from Assets to raw and try this. protected void openPDF() { if(Build.VERSION.SDK_INT>=24){ try{ Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");…
-
0
votes1
answer675
viewsA: Help Android Database Locked (code 5)
So I recommend: Make sure to close all instances of database helpers after you finish with them. Ensure that you always finalize your transactions with endTransaction() also if you are unsuccessful…
-
1
votes1
answer40
viewsA: Show information on Activity androd studio
Your Textview NotONG = (TextView) findViewById(R.id.NotNaoEncontradas); not being found in layout R.layout.activity_notificacao Make sure you set the correct layout or if there is a Textview in the…
-
5
votes2
answers418
viewsA: Android - Scratch text on a Listview
I hope this helps. TextView tv = (TextView) findViewById(R.id.mytext); tv.setText("Texto com risco"); tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);…
-
1
votes6
answers12886
viewsA: Doubt about logical operators && e || in Java
|| is equivalent to "or" and && is equivalent to "and" in its condition the first has to be different from null And the second different from empty. then the two conditions have to be true,…
-
1
votes1
answer329
viewsA: circle with Shape edges
In my projects I usually use this lib: https://github.com/hdodenhof/CircleImageView .xml <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"…
-
3
votes1
answer834
viewsA: Restore Deleted Android Studio Folder
I ended up poking around in the menu bar and ended up finding the solution. In the Android Studio menu bar go to View > Recent Changes and you will have the option "Revert"…
-
1
votes1
answer834
viewsQ: Restore Deleted Android Studio Folder
Hello I wonder if there is any way to restore a deleted folder inside Android Studio, in Eclipse there is the option "Restore from Local History" but I do not know if it is possible to do the same…
-
0
votes2
answers347
viewsA: Error while calling Activity
All you need to do is add android:theme="@style/ Theme.AppCompat.Light" to your Activity, in the archive AndroidManifest.xml.
-
0
votes2
answers81
viewsA: How to Capture UTC with an Android App
final Date currentTime = new Date(); final SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a…
-
0
votes1
answer39
viewsQ: Programmatically create Entity and save to core data
Hi, I was wondering how do I save an Entity in core data programmatically. I tried the following procedure: Passing parameter MatchCoreData().createEntity(name: "Partidas123") Func creating the…
-
4
votes4
answers7926
viewsA: How to Block Right Mouse Button and Block User from Viewing Source Code
It is not advisable to put this there ... document.oncontextmenu = document.body.oncontextmenu = function() {return false;}
javascriptanswered Edson Reis 624 -
1
votes1
answer151
viewsQ: File lost in Xcode
When I copy a Swift file and paste it from my folder, it does not appear in Xcode.…
-
0
votes1
answer26
viewsA: Problem opening Navigationdrawer
private Toolbar mToolbar; private ActionBarDrawerToggle mDrawerToggle; private NavigationView nav_view private void setupDrawerLayout() { mDrawerLayout = (DrawerLayout)…
androidanswered Edson Reis 624 -
0
votes2
answers514
viewsA: Query result null Firebase
You’re trying to turn into an object where restaurant is a list Try this @Override public void onDataChange(DataSnapshot dataSnapshot1) { for (DataSnapshot postSnapshot: dataSnapshot1.getChildren())…
-
0
votes1
answer582
viewsA: Android Development Recovering Firebase Data
1. Create a reference and list of each category. (Series, Movies, Animes) public ArrayList<Objeto> filmes; public ArrayList<Objeto> animes; public ArrayList<Objeto> series; public…
-
0
votes1
answer55
viewsA: Alertdialog with Fragmentmanager
Try extending to Dialogfragment your Mapsfragment class It would look something like this: Mapsfragment public class MapsFragment extends DialogFragment { private static View view; @Nullable…
-
1
votes1
answer314
viewsA: HTTP connection to server does not return JSON data
It may be that the request is not returning value, or the result of your json is not passing in the onPostExecute method() Try to separate responsibilities is good programming practice, makes it…
-
0
votes2
answers456
viewsA: How to set a background color and borders for my button beyond the states pressed and not pressed on the button with?
One way would be to do programmatically. Example: private boolean isChecked Change the button color when clicked button_1 = (Button) view.findViewById(R.id.button_1); button_1.setOnClickListener(new…
-
0
votes1
answer1292
viewsA: Android- Error "The virtual device got no IP address" Genymotion
Steps 1: Go to BIOS -> System Configuration -> Enable Virtualization Technology -> Save and Exit . Steps 2: Open Oracle VM Virtualbox -> Select your simulator -> Va to your simulator…
genymotionanswered Edson Reis 624 -
3
votes1
answer361
viewsQ: What is protocol-oriented programming?
I would like to know, what is protocol-oriented programming? I heard a teacher comment about this type of programming, about this paradigm, but it was a little vague.
-
1
votes1
answer190
viewsA: app ordering development, android firebase
You can use orderByChild. Example: DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference(); Query peopleTypeQuery = mDatabase.child("people").orderByChild("age");…
-
2
votes2
answers231
viewsA: Difficulty reading XML in Java
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; Document doc; try { builder = factory.newDocumentBuilder(); doc = builder.parse(new InputSource( new…
-
0
votes1
answer48
viewsA: Noclassdeffounderror after removing external API (Youtube)
Your error doesn’t show in which line it breaks? One of the answers below can help you solve your problem. 1- Try "Clean" and "Sync Project with Gradle Files". Run your project 2- It may be that…
-
1
votes2
answers748
viewsA: Limit access in app areas to different users
1.You have to have value that defines who is admin or user in your user database. Example: nivel = "admin" level = "function" You can use Realtime Database Firebase. to create a new user. Example.…
-
2
votes2
answers2660
viewsA: How to take value from a Radiobuton within a Radiogroup to save in the bank
You need to grab the radio button by the id then get the value of the text from that button. Try this code below. RadioGroup radioGroup = (RadioGroup)findViewById(R.id.youradio); String radiovalue…
-
1
votes2
answers627
viewsA: Button in Fragment android
fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dialogFragment = new DialogExample();…
-
1
votes2
answers772
viewsA: ...on a null Object Reference
Your strings have to start with a value, otherwise they will be null public String val1, val2, val3, val4, val5, val6; @Override protected void onCreate(Bundle savedInstanceState) {…
-
-3
votes1
answer112
viewsA: Selected Item Listview Retrofit
Product.setCodigoproduct(your list.get(position)); setCodigoean(your.get(position list)); Get the same Adapter list