I've added the internet permission code to my manifest but still i am getting No Network Security Config specified, using platform default
in my logcat. Through my code i am trying to fetch html code from url on pressing a button, but unfortunately my app is crashing.
here i am pasting my manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rekhahindwar.linksaver" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".UrlFetcher" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and my java class is here-
public class UrlFetcher extends AppCompatActivity implements View.OnClickListener {
EditText url;
Button fetch;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initialize();
}
private void initialize() {
url = (EditText) findViewById(R.id.url);
fetch = (Button) findViewById(R.id.fetch);
fetch.setOnClickListener(this);
}
@Override
public void onClick(View v) {
String baseurl = url.getText().toString();
Document doc = null;
try {
doc = Jsoup.connect(baseurl).get();
} catch (IOException e) {
e.printStackTrace();
}
}
}