Архив

Архив раздела ‘Android’
import android.content.Intent;
class MyClient extends WebViewClient{
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url){
        if(url.startsWith("mailto:")){
            view.getContext().startActivity(new Intent(Intent.ACTION_SENDTO, Uri.parse(url)));
        }
        else if(url.startsWith("tel:")) {
            view.getContext().startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse(url)));
        }
        else {
            view.loadUrl(url);
        }
        return true;
    }
}
Categories: Android Tags:

Добавить getSupportActionBar().hide();
Пример:

public class MainActivity extends AppCompatActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
		getSupportActionBar().hide();
		setContentView(R.layout.activity_main);
	}
}
Categories: Android Tags:
if($_SERVER['HTTP_X_REQUESTED_WITH']=='com.example.app'){
	echo 'Это мое приложение, а не мобильный браузер';
}

com.example.app — имя нашего пакета

Categories: Android, PHP Tags: ,