carefacerz
carefacerz

Reputation: 1297

Android Development: Text contain

i have a editText, so how do i check if the editText contain like "http://www."?

Is this possible to see if a component contain a specific string?

Thank-you

PS. is it also possible to change android:theme(like no title) at runtime?

Upvotes: 0

Views: 163

Answers (2)

techi.services
techi.services

Reputation: 8533

For Example

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Log.i(tag, "onCreate");

    main = this;

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.main);

Upvotes: 0

techi.services
techi.services

Reputation: 8533

IIRC the titlebar needs to be removed in the Activity onCreate before you call setContentView.

I use

getWindow().requestFeature(Window.FEATURE_NO_TITLE);

As for the text search use

String.contains("http://www");

Upvotes: 2

Related Questions