I am working on a custom listView and within the array adapter I have tried code from other posts to have the soft keyboard disappear when the "Done" button on the soft keyboard is pressed. The problem is since (I think) I need to put the code in the custom adapter class and not in an Activity class where the other answers assume you are working in. Here is all my code.

MainActivity.java

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewSwitcher;

import java.util.ArrayList;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final ArrayList<String> Chores = new ArrayList<>();
        Chores.add("");
        //final String[] Chores = {"", "", ""};
        final ListAdapter MyAdapter = new CustomAdapter(this, Chores);
        ListView listViewObject = (ListView)findViewById(R.id.customListView_ID);
        listViewObject.setAdapter(MyAdapter);

        listViewObject.setOnItemClickListener(
            new AdapterView.OnItemClickListener(){
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id){
                    String ChoreString = String.valueOf(parent.getItemAtPosition(position));




                }
            }

        );
        final Button button = (Button) findViewById(R.id.button_ID);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Chores.add("");
                ((ArrayAdapter)MyAdapter).notifyDataSetChanged();

            }

        });




    }
}

CustomAdapter.java

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;


class CustomAdapter extends ArrayAdapter{

    public CustomAdapter(Context context, ArrayList choreText) {
        super(context, R.layout.custon_listview_row, choreText);
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater myInflater = LayoutInflater.from(getContext());
        View customView = myInflater.inflate(R.layout.custon_listview_row, parent, false);

        String singleListItem = (String) getItem(position);
        final TextView choreTextStatic = (TextView) customView.findViewById(R.id.textView_ID);
        final EditText choreTextEdit = (EditText) customView.findViewById(R.id.editText_ID);
        //set user input in editText field
        choreTextEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                boolean handled = false;
                if (actionId == EditorInfo.IME_ACTION_DONE) {
                    // TODO do something
                    choreTextStatic.setVisibility(View.VISIBLE);
                    choreTextEdit.setVisibility(View.INVISIBLE);

                    // This is where I am trying to make soft keyboard disapear

                    handled = true;
                }
                return handled;
            }
        });

        ImageButton imageButton = (ImageButton) customView.findViewById(R.id.imageButton_ID);

        choreTextEdit.setText(singleListItem, TextView.BufferType.EDITABLE);



        imageButton.setImageResource(R.drawable.clock);



        return customView;
    }
}

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.emilythacker.chorelist.MainActivity">

    <ListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/customListView_ID"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true"
        android:layout_marginTop="50dp" />

    <Button
        android:text="Add Chore"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true"
        android:id="@+id/button_ID" />
</RelativeLayout>

custom_listview_row.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="60dp">

    <ImageButton
        android:layout_width="60dp"
        android:scaleType="fitCenter"
        app:srcCompat="@drawable/clock"
        android:id="@+id/imageButton_ID"
        android:layout_height="60dp"
        android:background="@null"
        android:layout_alignParentRight="true"
        android:padding="5dp"
        android:layout_weight="1" />



    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:id="@+id/editText_ID"
        android:layout_alignParentLeft="true"
        android:alpha = ".5"
        android:hint="Enter chore"
        android:maxLines="1"
        android:inputType="text"
        android:imeOptions="actionDone" />

    <TextView
        android:text="TextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:id="@+id/textView_ID"
        android:layout_alignBaseline="@+id/editText_ID"
        android:layout_alignBottom="@+id/editText_ID"
        android:layout_alignParentStart="true"
        android:visibility="invisible"
        android:imeOptions="actionDone"/>


</RelativeLayout>

I have a basic shape inside of my Drawable folder which was easy to make, but I'm looking for something more specific and would be nice if exists any tool which I can create my shapes and transform into XML code, like this website Android Drawble Generator. Thanks!

This is my code:

UIImage *image1 = [UIImage imageNamed:@"AllMyFiles-1 (dragged).tiff"];
cell.imageView.image = image1;

cell.textLabel.text = self.greekLetters[indexPath.row];

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

cell.imageView.contentMode = UIViewContentModeScaleAspectFit;

And this is is what it looks like: tableview with image

And I want the UIImage to be a bit smaller much like this: tableview with smaller image

can someone help me parsing the media:thumbnail url value from an RSSItem using simpleXml.

Here is my RSSItem class :

 @Root(name = "item", strict = false)
public class FeedItem {
    @Element(name = "pubDate")
    private String pubDate;
    @Element(name = "title")
    private String title;
    @Element(name = "link")
    private String link;
    @Element(name = "description")
    private String description;


    public FeedItem() {
    }



    public FeedItem(String description, String link, String title, String pubDate) {
        this.description = description;
        this.link = link;
        this.title = title;
        this.pubDate = pubDate;
    }

    public String getPubDate() {
        return pubDate;
    }

    public void setPubDate(String pubDate) {
        this.pubDate = pubDate;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


}

it all works ok, but i need to parse also the image url from the xml (media:thumbnail) here :

<media:thumbnail url="https://tctechcrunch2011.files.wordpress.com/2016/12/gettyimages-591407481.jpg" />

Any hints will be much appreciated !

I am very new to React native and have run into lots of problems with my POST request and done lots of research on the Internet to make this work, however I keep getting "undefined" all the time.

This is all my code in index.android.js:

import React, { Component } from 'react';
import { AppRegistry, Alert, StyleSheet, View, TextInput, TouchableHighlight, Text } from 'react-native';   

var DroverDaniel = React.createClass({

  _onPressButtonPOST: function() {

    let myBody = JSON.stringify({"partner[email]": "daniel.smith@gmail.com", "partner[password]": "mypassword"});

    let myInit = { method: 'POST', cache: 'default', body: myBody };

    fetch("https://drover-test.herokuapp.com/app_partners/sign_in", myInit).then(function(response) {
      return response.json();
    }).then(function(j) {    
      Alert.alert("POST Response", "Response Body -> " + j.api_token)
      console.log(j);
    }).catch(function(err) {
    console.log(err);
    // Alert.alert("Response Body -> " +err);
    });

  },



  render: function() {
    return (
      <View style={styles.container}>      
      <TouchableHighlight onPress={this._onPressButtonPOST} style={styles.button}>
      <Text>POST</Text>
      </TouchableHighlight>
      </View>
      );
  },

});

  var styles = StyleSheet.create({
   container: {
     flex: 1,
     flexDirection: 'row',
     justifyContent: 'center',
     alignItems: 'center',
     backgroundColor: '#F5FCFF',
   },
   button: {
     backgroundColor: '#eeeeee',
     padding: 10,
     marginRight: 5,
     marginLeft: 5,
   }
 });

AppRegistry.registerComponent('DroverDaniel', () => DroverDaniel);

I have tested the API in Postman and this works - this is what I should get for this simple login POST request:

{
  "id": 40,
  "email": "daniel@some-email.com",
  "first_name": "Daniel",
  "last_name": "Smith",
  "api_token": "ffZWYC8Z4zD3-c4y9mT3"
}

Unfortunately the .catch does not show any errors in the "console" - I'm assuming the terminal server I'm running. And trying to output the error in the Alert box, also yields no results.

I've been stuck on this pretty much all day, so any help would be greatly appreciated!

I want to set the text in an EDITTEXT knowing his tag, but the text is not set, where am I wrong?

 @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_OK) {
      if (requestCode == REQ_CODE_PASSWORD) {
            int tag_ed = data.getIntExtra("EDGeneraPSW_position", 0);  
            View childView = rlCampi.getChildAt(tag_ed);
            String stringa_da_settare = data.getStringExtra("password"); 

            if (childView instanceof MaterialEditText) {
                MaterialEditText ed = (MaterialEditText) childView;
                ed.setText(stringa_da_settare);
            }
...
...
}
    }

}

I'm very new to Android Application Development. I know my problem might be simple one. but, I'm sure it is related to layout.

Here's my issue: There's is a listView in the Fragment. When I click the button the new Fragment is added to the ScrollView in the main Layout. When I start the activity one fragment is already added to the activity. So, when I change the rotation the application does not crash.

But, new Fragment is added in the ScrollView after clicking button. But this time when I change the Rotation of the device the Application crashes giving following the error in the end. Can you help me solve this problem. Error occurs only when I change rotaion otherwise app runs fine.

Layout(XML) File activity_another_custom_list_view.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_another_custom_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.practices.app.practices.AnotherCustomListViewActivity"
android:background="@drawable/border">


<Button
    android:text="@string/add_fragments"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/button"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="20dp"
    android:onClick="addfrag"/>

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/button">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">



<fragment
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:name="com.practices.app.practices.AnotherCustomListViewFragment"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:id="@+id/fragment"
    />

    </LinearLayout>

</ScrollView>
</RelativeLayout>

Fragment Layout another_custom_listview_fragment.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">


<ListView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/fraglistview"></ListView>

</LinearLayout>

Java File AnotherCustomListViewActivity.java

package com.practices.app.practices;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.view.View;

public class AnotherCustomListViewActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_another_custom_list_view);


}

public void addfrag(View v){
    AnotherCustomListViewFragment f = new AnotherCustomListViewFragment();
    FragmentManager fm = getFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ft.add(R.id.fragment,f);
    ft.commit();
}
}

Fragment Java Class AnotherCustomListViewFragment

package com.practices.app.practices;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Adapter;
import android.widget.ListAdapter;
import android.widget.ArrayAdapter;
import android.widget.ListView;


public class AnotherCustomListViewFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.another_custom_listview_fragment, container, false);

    String[] str = {"a","b","c","d"};
    ListView fraglist = (ListView) view.findViewById(R.id.fraglistview);
    ListAdapter listadapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, str);
    fraglist.setAdapter(listadapter);

    return view;
}
}

Here's the full Error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.practices.app.practices/com.practices.app.practices.AnotherCustomListViewActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class fragment
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2426)
                  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3994)
                  at android.app.ActivityThread.access$1000(ActivityThread.java:155)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
                  at android.os.Looper.loop(Looper.java:135)
                  at android.app.ActivityThread.main(ActivityThread.java:5318)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at java.lang.reflect.Method.invoke(Method.java:372)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:922)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:717)
               Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class fragment
                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
                  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)
                  at com.practices.app.practices.AnotherCustomListViewActivity.onCreate(AnotherCustomListViewActivity.java:15)
                  at android.app.Activity.performCreate(Activity.java:6024)
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2426) 
                  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3994) 
                  at android.app.ActivityThread.access$1000(ActivityThread.java:155) 
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337) 
                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                  at android.os.Looper.loop(Looper.java:135) 
                  at android.app.ActivityThread.main(ActivityThread.java:5318) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at java.lang.reflect.Method.invoke(Method.java:372) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:922) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:717) 
               Caused by: java.lang.IllegalStateException: Fragment com.practices.app.practices.AnotherCustomListViewFragment did not create a view.
                  at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2145)
                  at android.app.Activity.onCreateView(Activity.java:5373)
                  at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:36)
                  at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:77)
                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143) 
                  at com.practices.app.practices.AnotherCustomListViewActivity.onCreate(AnotherCustomListViewActivity.java:15) 
                  at android.app.Activity.performCreate(Activity.java:6024) 
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317) 
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2426) 
                  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3994) 
                  at android.app.ActivityThread.access$1000(ActivityThread.java:155) 
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337) 
                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                  at android.os.Looper.loop(Looper.java:135) 
                  at android.app.ActivityThread.main(ActivityThread.java:5318) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at java.lang.reflect.Method.invoke(Method.java:372) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:922) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:717) 

I coded this in order to get a Filter icon at OptionsMenu.I was using an empty meny with drawable image and the onClick of that was showing a DialogFragment. But this doesn't work fine as an empty title item appears on the OptionsMenu clicking which my DialogFragment gets open. I appreciate any help. Thanks.

menu file for OptionsMenu :

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"  >
<item android:id="@+id/filter"
    android:orderInCategory="100"
    android:icon="@drawable/filter_icon"
    android:showAsAction="ifRoom|withText"
    android:title="hi" />
</menu>

This is myactivity :

public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.menu,menu);
   return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.

    String[] values = new String[]{ "Veg.",
            "Non Veg.",
            "Veg & Non veg."

    };
    int id = item.getItemId();
    if (id == R.id.filter) {
        RestaurantListingFragment restaurant_categories_dialog = new      RestaurantListingFragment();
        android.app.FragmentManager fm = getFragmentManager();

        Bundle args = new Bundle();
        args.putStringArray("restaurantCategories",values);

        restaurant_categories_dialog.setArguments(args);

        // Show DialogFragment
        restaurant_categories_dialog.show(fm, "hi");

        return true;
    }
    return super.onOptionsItemSelected(item);
}

This is my fragment class:

public class RestaurantListingFragment extends DialogFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,   Bundle savedInstanceState) {
   View rootView = inflater.inflate(R.layout.fragment_dialog_restaurant_categories, container,false);
    getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    String[] restaurantCategories = getArguments().getStringArray("restaurantCategories");

    if(restaurantCategories != null)
    {
        ListView lv=(ListView) rootView.findViewById(R.id.fd_lv);
        ArrayAdapter arrayAdapter =new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1,android.R.id.text1,restaurantCategories);
        lv.setAdapter(arrayAdapter);
    }
    return rootView;
 }
 }

Manifests :

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="cresol.demo.drestodemo">

 <application
    android:allowBackup="true"
    android:hardwareAccelerated="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true">
    <activity
        android:name=".Home"
        android:theme="@style/NoTitle">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".signup"
        android:theme="@style/NoTitle" />
    <activity
        android:name=".RestaurantListing"
        android:theme="@style/AppTheme" />
    <activity android:name=".DishListing"
        android:theme="@style/AppTheme"></activity>
 </application>

 </manifest>

When a progressive web app (with service worker) shows a notification, the notification displayed in the notification drawer has the icon that I supply and looks fine.

However, when the drawer is closed, the status bar icon associated with that notification is specific to Chrome, shown here in the red circle. This happens whether viewed as a web page or when added to the home screen and running with display "standalone". enter image description here

Is there any way for a PWA to specify the icon that shows in the status bar?

Currently I am unable to play a video. On the emulator it says Cant play this video. And in my log it tives the E/MediaPlayer: error (1, -38)

Currently in my code I have a viewpager which inflates full screen. Here I call a getVideoURL method which creates an Array of URLs. Once that method has finished it gets sent to a handler which will display the video as follows.

    private Handler handler = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        switch (msg.what) {
            case 1:
                mVideoView.setMediaController(new MediaController(getActivity()));
                mVideoView.setVideoURI(Uri.parse(videos.get(0)));
                mVideoView.requestFocus();
                mVideoView.start();

                break;
            default:
                Log.d("TAG", msg.what + " ? ");
                break;
        }
    }
};

i find for some examples to use the fingerprint reader integrated in the device to obtain the result of passing the fingerprint by the reader.

I'm new to Android. In my app, I'm using holders and at one point (e.g. when I refresh the activity), I want to reset a certain tag. Is it possible? And if so, how?

Thank you.

i am new in Android Development with no big knowledge around java. I know how to record sound with start/stop buttons and i also know how to record audio with long press on button, but i want it to auto stop after 10 seconds. I have read older post in hear but i can not add the missing code, like the one from this link Recording data using microphone for a fixed duration or this record voice for a specific time period in android . If someone can help me please post almost all the code after import staffs, since i am not good in java yet. Thank you for your help and sorry for my english.

i am new to animations. i want to move a button(button1) when i am click on it threw x-axis. here is my code:

    btn=(Button)findViewById(R.id.button1);
    currentX=btn.getX();
    currentY=btn.getY();
    moveX=ObjectAnimator.ofFloat(btn,"translationX",currentX,currentX+10);
    moveY=ObjectAnimator.ofFloat(btn,"translationY",currentY,currentY);
    set=new AnimatorSet();
    set.playTogether(moveX,moveY);

    btn.setOnClickListener(new View.OnClickListener()
    {
        public void onClick(View v){
            set.start();
            currentX=v.getX();
            currentY=v.getY();
        }
    });

It moves at the first click,but after that it just starts from the beginning instead of moving 10dp further on the x-axis.what am i missing? thank you:)

I am trying to implement deep linking in my Android application but have run into an issue.

When I test the links from adb the Activity opens as expected. However, from the browser the link which is specified in the manifest does not open the application and instead just opens a page on the browser.

My Activity in the manifest:

<activity
        android:name=".Activities.AccountsActivity"
        android:screenOrientation="portrait"
        android:launchMode="singleTask"
        android:label="Accounts" >
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category  android:name="android.intent.category.DEFAULT"/>
            <category  android:name="android.intent.category.BROWSABLE"/>
            <data
                android:host="www.mywebsite.com"
                android:scheme="https" />
        </intent-filter>
    </activity>

This is the adb command I used which worked:

 adb shell am start -a android.intent.action.VIEW -d "https://www.mywebsite.com" com.company.app 

So, shouldn't opening https:/www.mywebsite.com (removed one '/' so that hyperlink is disabled) in the browser open my application, or at least show the application picker? Perhaps I'm understanding this incorrectly.

When I receive a push notification, I add the notification payload to my DB in the following way:

personObject.insertObjectIntoDb(searchResult, value, oneOnOneChannel).observeOn(Schedulers.computation()).subscribe(insertSinglePersonSubscriber);

I have a Subscriber instantiated in the onCreate() of my activity.

insertSub = new Subscriber<Long>() {
    @Override
    public void onCompleted() {
        Log.d(TAG, "onCompleted: insertSub complete");
    }

    @Override
    public void onError(Throwable e) {
        Log.d(TAG, "onError: insertSub error");
    }

    @Override
    public void onNext(Long aLong) {
        Log.d(TAG, "onNext: insertSub next");
    }
};

On the first invocation of personObject.insertObjectIntoDb(), the onComplete() of insertSub is called, just as expected.

This would mean the now the subscription has ended and the subscriber gets unsubscribed.

However, I don't want to stop the subscription and want the insertSub callbacks to be called every time there's a new push notification.

I've been reading about share() for one observable and multiple subscribers but that's not what I want. I read about replay() but it the observable never stops emitting (oops). Changing Subscriber to Observer also didn't help and on more thorough reading I found that Subscriber inherits from Observer and the same rules apply (apart from the fact the with a subscriber we need to unsubscribe.

I am not sure if the observer stops emitting (after emitting once). How do I make the observer emit multiple times, whenever there's a new notification?

Also, what's the best way to re-establish the subscription?

I use this layout to show an image in my RecyclerView:

<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/picture"
    android:layout_width="match_parent"
    android:layout_height="match_parent"    
    android:scaleType="centerCrop" />

I load a picture with Glide library like that:

Glide.with(context)
    .load(my_url)
    .skipMemoryCache(true)
    .placeholder(R.drawable.default_medium_wide_picture)
    .crossFade()
    .into(contentHolder.mImageView);

The height of ImageView is computed during the viewholder creation according the width screen:

DisplayMetrics metrics = MyApplication.getInstance().getResources().getDisplayMetrics();
imageView.getLayoutParams().height = Math.round(metrics.widthPixels * Defines.IMAGE_HEIGHT_RATIO);

The result is perfect on 4.4.4 Android version:

enter image description here

But on 4.1.1 Android version the result expected is bad:

enter image description here

Thanks by advance guys for your help!

In my class A, i have a variable defined as follows:

var auth_token:String?
var _auth_token:String {get{return self.auth_token!} set{auth_token = newValue}

now i want to access this auth_token from other viewcontroller class. How can i achieve this. If i make a new instance of the class it will return me nil as expected.

The app I'm working on requires a navigation stack to be inset by 5 pixels on each side. So I'm using a container view controller with a UINavigationController as a child. I'm laying out the navigation's view as a contentNode using AsyncDisplayKit:

override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
    guard let contentNode = contentNode else { return ASLayoutSpec() }
    let insets = UIEdgeInsets.inset(padding: 5)
    let overlaySpec = ASOverlayLayoutSpec(child: containerNode, overlay: contentNode)
    return overlaySpec.withInset(insets: insets)
}

enter image description here

This works fine except for the screen edge gesture for going back. Swiping from the edge of the navigation's view is ok, but if you swipe from the edge of the screen, it is now not detected.

Is there any way to forward the event from the container view controller to the navigation controller? Or is there a way to have a navigation's view respond to a touch that occurs outside of its bounds?

I've never been using Xcode to sideload apps on my iPad instead,I used Cydia Impactor. We all knows that the limitation is every free Apple developer account comes with a 7-days provisioning profile. In other words, after a week, you will need to repeat this process again for the app to work. I got this app which is not available anymore in app store and this app I've been playing consists savedata,etc. So,my question is how do I renew/refresh/re-play/(you name it) the same app/game without deleting the old data but conserving/save the old data? Because,after a week I've been playing in that game,I feel sad when the app crashed,,urgh,I really hope that Apple at least return back the 1 year provisioning profile... PLease help me

FOCUS

1-Example,I downloaded the app 1/1/2016

2- A week later 8/1/2016 (it turns to old data)

3- IF let say,on 9 or 10/1/2016 (new data),,,how do I keep the old savesdata from the old provisioning profile dated (1/1/2016)?

aid me please :(