bold and italics in edittext
up vote
-1
down vote
favorite
In the edit text, the user should select whether what they type should be bold or italics or normal. In my case when a user selects bold the entire edit text changes to bold and if he again selects italics the entire edit text becomes italics. When the user selects bold types something, it should be bold and when he selects italics or normal the words that he types after that should be italics or normal, not the previous one which is bold. also when I print the input in edit text it is printed as normal even it is given as bold.
I have my code at the bottom
<EditText
android:id="@+id/check_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="check"
/>
this is where I have set the edit text to bold or italics
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.BOLD);
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.ITALIC);
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.NORMAL);
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(editCheck.getText().toString());
}
});
How can I implement this
java android xml
add a comment |
up vote
-1
down vote
favorite
In the edit text, the user should select whether what they type should be bold or italics or normal. In my case when a user selects bold the entire edit text changes to bold and if he again selects italics the entire edit text becomes italics. When the user selects bold types something, it should be bold and when he selects italics or normal the words that he types after that should be italics or normal, not the previous one which is bold. also when I print the input in edit text it is printed as normal even it is given as bold.
I have my code at the bottom
<EditText
android:id="@+id/check_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="check"
/>
this is where I have set the edit text to bold or italics
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.BOLD);
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.ITALIC);
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.NORMAL);
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(editCheck.getText().toString());
}
});
How can I implement this
java android xml
And what is exactly your problem? As I have seen in your code when you do the setText to the result it is printing as normal. When you change the typeface it is changing eventhough you have written text?
– Brank Victoria
Nov 21 at 14:20
when I click bold entire text changes, even text that I have typed before,I want the text typed after selecting bold should only become bold. And in the result it should be printed as it typed in the edittext. In my code I didnt know how to implement that.
– Siva perumal
Nov 21 at 14:29
Thiswhen I click bold entire text changes
do you mean that changes to bold? Or another text?
– Brank Victoria
Nov 21 at 14:30
every word in the edittext changes to bold, but what I want is only the text that I start typing after the bold button is clicked should be bold.
– Siva perumal
Nov 21 at 14:31
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
In the edit text, the user should select whether what they type should be bold or italics or normal. In my case when a user selects bold the entire edit text changes to bold and if he again selects italics the entire edit text becomes italics. When the user selects bold types something, it should be bold and when he selects italics or normal the words that he types after that should be italics or normal, not the previous one which is bold. also when I print the input in edit text it is printed as normal even it is given as bold.
I have my code at the bottom
<EditText
android:id="@+id/check_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="check"
/>
this is where I have set the edit text to bold or italics
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.BOLD);
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.ITALIC);
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.NORMAL);
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(editCheck.getText().toString());
}
});
How can I implement this
java android xml
In the edit text, the user should select whether what they type should be bold or italics or normal. In my case when a user selects bold the entire edit text changes to bold and if he again selects italics the entire edit text becomes italics. When the user selects bold types something, it should be bold and when he selects italics or normal the words that he types after that should be italics or normal, not the previous one which is bold. also when I print the input in edit text it is printed as normal even it is given as bold.
I have my code at the bottom
<EditText
android:id="@+id/check_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="check"
/>
this is where I have set the edit text to bold or italics
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.BOLD);
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.ITALIC);
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCheck.setTypeface(editCheck.getTypeface(), Typeface.NORMAL);
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(editCheck.getText().toString());
}
});
How can I implement this
java android xml
java android xml
edited Nov 21 at 14:37
Eren ÇELİK
354
354
asked Nov 21 at 14:16
Siva perumal
275
275
And what is exactly your problem? As I have seen in your code when you do the setText to the result it is printing as normal. When you change the typeface it is changing eventhough you have written text?
– Brank Victoria
Nov 21 at 14:20
when I click bold entire text changes, even text that I have typed before,I want the text typed after selecting bold should only become bold. And in the result it should be printed as it typed in the edittext. In my code I didnt know how to implement that.
– Siva perumal
Nov 21 at 14:29
Thiswhen I click bold entire text changes
do you mean that changes to bold? Or another text?
– Brank Victoria
Nov 21 at 14:30
every word in the edittext changes to bold, but what I want is only the text that I start typing after the bold button is clicked should be bold.
– Siva perumal
Nov 21 at 14:31
add a comment |
And what is exactly your problem? As I have seen in your code when you do the setText to the result it is printing as normal. When you change the typeface it is changing eventhough you have written text?
– Brank Victoria
Nov 21 at 14:20
when I click bold entire text changes, even text that I have typed before,I want the text typed after selecting bold should only become bold. And in the result it should be printed as it typed in the edittext. In my code I didnt know how to implement that.
– Siva perumal
Nov 21 at 14:29
Thiswhen I click bold entire text changes
do you mean that changes to bold? Or another text?
– Brank Victoria
Nov 21 at 14:30
every word in the edittext changes to bold, but what I want is only the text that I start typing after the bold button is clicked should be bold.
– Siva perumal
Nov 21 at 14:31
And what is exactly your problem? As I have seen in your code when you do the setText to the result it is printing as normal. When you change the typeface it is changing eventhough you have written text?
– Brank Victoria
Nov 21 at 14:20
And what is exactly your problem? As I have seen in your code when you do the setText to the result it is printing as normal. When you change the typeface it is changing eventhough you have written text?
– Brank Victoria
Nov 21 at 14:20
when I click bold entire text changes, even text that I have typed before,I want the text typed after selecting bold should only become bold. And in the result it should be printed as it typed in the edittext. In my code I didnt know how to implement that.
– Siva perumal
Nov 21 at 14:29
when I click bold entire text changes, even text that I have typed before,I want the text typed after selecting bold should only become bold. And in the result it should be printed as it typed in the edittext. In my code I didnt know how to implement that.
– Siva perumal
Nov 21 at 14:29
This
when I click bold entire text changes
do you mean that changes to bold? Or another text?– Brank Victoria
Nov 21 at 14:30
This
when I click bold entire text changes
do you mean that changes to bold? Or another text?– Brank Victoria
Nov 21 at 14:30
every word in the edittext changes to bold, but what I want is only the text that I start typing after the bold button is clicked should be bold.
– Siva perumal
Nov 21 at 14:31
every word in the edittext changes to bold, but what I want is only the text that I start typing after the bold button is clicked should be bold.
– Siva perumal
Nov 21 at 14:31
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
If you want different font styles in your text view you can set it from HTML. Take a look to this post:
Is it possible to have multiple styles inside a TextView?
So in your case you can save the text entered in HTML format depending on what the user clicked to put <b>
for bold, <i>
for italics and so.
This will also help you to print it in the result textView, because you will print it from the HTML.
EDIT: For solve the problem that all your text is getting bold or italic, you must edit your onclick events to know the type of what you are writing. And also use TextWatcher to know what is the inserted text. For example:
int typeFaceSelected = Typeface.NORMAL //private global var with NORMAL as default value
String resultedText = ""; //private global var, this will give to your textview the result of the edittext in HTML
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.BOLD
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.ITALIC
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.NORMAL
}
});
//You can edit the text you add
editCheck.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
String sAux = s.toString().subString(start, start + count);
switch(typeFaceSelected)
{
case Typeface.NORMAL:
resultedText = sAux;
break;
case Typeface.ITALIC:
resultedText = "<i>" + sAux + "</i>";
break;
case Typeface.BOLD:
resultedText = "<b>" + sAux + "</b>";
break;
}
editCheck.setText(Html.fromHtml(resultedText));
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(HTML.fromHTML(resultedText));
}
});
The above code was based on this Differences between TextWatcher 's onTextChanged, beforeTextChanged and afterTextChanged
Also, I haven't test it so I'm not sure if its working or not, but at least I think it is enough to get the idea.
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
If you want different font styles in your text view you can set it from HTML. Take a look to this post:
Is it possible to have multiple styles inside a TextView?
So in your case you can save the text entered in HTML format depending on what the user clicked to put <b>
for bold, <i>
for italics and so.
This will also help you to print it in the result textView, because you will print it from the HTML.
EDIT: For solve the problem that all your text is getting bold or italic, you must edit your onclick events to know the type of what you are writing. And also use TextWatcher to know what is the inserted text. For example:
int typeFaceSelected = Typeface.NORMAL //private global var with NORMAL as default value
String resultedText = ""; //private global var, this will give to your textview the result of the edittext in HTML
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.BOLD
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.ITALIC
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.NORMAL
}
});
//You can edit the text you add
editCheck.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
String sAux = s.toString().subString(start, start + count);
switch(typeFaceSelected)
{
case Typeface.NORMAL:
resultedText = sAux;
break;
case Typeface.ITALIC:
resultedText = "<i>" + sAux + "</i>";
break;
case Typeface.BOLD:
resultedText = "<b>" + sAux + "</b>";
break;
}
editCheck.setText(Html.fromHtml(resultedText));
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(HTML.fromHTML(resultedText));
}
});
The above code was based on this Differences between TextWatcher 's onTextChanged, beforeTextChanged and afterTextChanged
Also, I haven't test it so I'm not sure if its working or not, but at least I think it is enough to get the idea.
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
add a comment |
up vote
1
down vote
If you want different font styles in your text view you can set it from HTML. Take a look to this post:
Is it possible to have multiple styles inside a TextView?
So in your case you can save the text entered in HTML format depending on what the user clicked to put <b>
for bold, <i>
for italics and so.
This will also help you to print it in the result textView, because you will print it from the HTML.
EDIT: For solve the problem that all your text is getting bold or italic, you must edit your onclick events to know the type of what you are writing. And also use TextWatcher to know what is the inserted text. For example:
int typeFaceSelected = Typeface.NORMAL //private global var with NORMAL as default value
String resultedText = ""; //private global var, this will give to your textview the result of the edittext in HTML
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.BOLD
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.ITALIC
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.NORMAL
}
});
//You can edit the text you add
editCheck.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
String sAux = s.toString().subString(start, start + count);
switch(typeFaceSelected)
{
case Typeface.NORMAL:
resultedText = sAux;
break;
case Typeface.ITALIC:
resultedText = "<i>" + sAux + "</i>";
break;
case Typeface.BOLD:
resultedText = "<b>" + sAux + "</b>";
break;
}
editCheck.setText(Html.fromHtml(resultedText));
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(HTML.fromHTML(resultedText));
}
});
The above code was based on this Differences between TextWatcher 's onTextChanged, beforeTextChanged and afterTextChanged
Also, I haven't test it so I'm not sure if its working or not, but at least I think it is enough to get the idea.
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
add a comment |
up vote
1
down vote
up vote
1
down vote
If you want different font styles in your text view you can set it from HTML. Take a look to this post:
Is it possible to have multiple styles inside a TextView?
So in your case you can save the text entered in HTML format depending on what the user clicked to put <b>
for bold, <i>
for italics and so.
This will also help you to print it in the result textView, because you will print it from the HTML.
EDIT: For solve the problem that all your text is getting bold or italic, you must edit your onclick events to know the type of what you are writing. And also use TextWatcher to know what is the inserted text. For example:
int typeFaceSelected = Typeface.NORMAL //private global var with NORMAL as default value
String resultedText = ""; //private global var, this will give to your textview the result of the edittext in HTML
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.BOLD
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.ITALIC
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.NORMAL
}
});
//You can edit the text you add
editCheck.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
String sAux = s.toString().subString(start, start + count);
switch(typeFaceSelected)
{
case Typeface.NORMAL:
resultedText = sAux;
break;
case Typeface.ITALIC:
resultedText = "<i>" + sAux + "</i>";
break;
case Typeface.BOLD:
resultedText = "<b>" + sAux + "</b>";
break;
}
editCheck.setText(Html.fromHtml(resultedText));
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(HTML.fromHTML(resultedText));
}
});
The above code was based on this Differences between TextWatcher 's onTextChanged, beforeTextChanged and afterTextChanged
Also, I haven't test it so I'm not sure if its working or not, but at least I think it is enough to get the idea.
If you want different font styles in your text view you can set it from HTML. Take a look to this post:
Is it possible to have multiple styles inside a TextView?
So in your case you can save the text entered in HTML format depending on what the user clicked to put <b>
for bold, <i>
for italics and so.
This will also help you to print it in the result textView, because you will print it from the HTML.
EDIT: For solve the problem that all your text is getting bold or italic, you must edit your onclick events to know the type of what you are writing. And also use TextWatcher to know what is the inserted text. For example:
int typeFaceSelected = Typeface.NORMAL //private global var with NORMAL as default value
String resultedText = ""; //private global var, this will give to your textview the result of the edittext in HTML
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.BOLD
}
});
italics.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.ITALIC
}
});
normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
typeFaceSelected = Typeface.NORMAL
}
});
//You can edit the text you add
editCheck.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
String sAux = s.toString().subString(start, start + count);
switch(typeFaceSelected)
{
case Typeface.NORMAL:
resultedText = sAux;
break;
case Typeface.ITALIC:
resultedText = "<i>" + sAux + "</i>";
break;
case Typeface.BOLD:
resultedText = "<b>" + sAux + "</b>";
break;
}
editCheck.setText(Html.fromHtml(resultedText));
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
result.setText(HTML.fromHTML(resultedText));
}
});
The above code was based on this Differences between TextWatcher 's onTextChanged, beforeTextChanged and afterTextChanged
Also, I haven't test it so I'm not sure if its working or not, but at least I think it is enough to get the idea.
edited Nov 21 at 16:28
answered Nov 21 at 14:37
Brank Victoria
1,038615
1,038615
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
add a comment |
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
even when I use html and the bold button is clicked, even the previously typed words are changed to bold. actually what I want is only when the user selects bold it should be bold from that word and not the previous word.
– Siva perumal
Nov 21 at 15:26
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
I know what you're saying, but in this case. You must change your code. This means that you have to change the logic inside your onclick events. Let me edit my answer so it would be clearer for you
– Brank Victoria
Nov 21 at 15:55
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
ok even I thought that would be the mistake but the logic is what I am not getting.
– Siva perumal
Nov 21 at 16:14
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
@Sivaperumal take a look to the edition of the answer so you can understand what I am talking about.
– Brank Victoria
Nov 21 at 16:32
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
it didnt work but yes it gave me an idea of how to do this, thanks. I will try it
– Siva perumal
Nov 23 at 13:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53414053%2fbold-and-italics-in-edittext%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
And what is exactly your problem? As I have seen in your code when you do the setText to the result it is printing as normal. When you change the typeface it is changing eventhough you have written text?
– Brank Victoria
Nov 21 at 14:20
when I click bold entire text changes, even text that I have typed before,I want the text typed after selecting bold should only become bold. And in the result it should be printed as it typed in the edittext. In my code I didnt know how to implement that.
– Siva perumal
Nov 21 at 14:29
This
when I click bold entire text changes
do you mean that changes to bold? Or another text?– Brank Victoria
Nov 21 at 14:30
every word in the edittext changes to bold, but what I want is only the text that I start typing after the bold button is clicked should be bold.
– Siva perumal
Nov 21 at 14:31