मैं कैसे कर सकते हैं आसान बनाने में सभी इस कोड? मैं निर्माण कर रहा हूँ एक खोज मेनू पर जाएँ और मैं चाहते हैं के लिए मूल्यों की जाँच जब उपयोगकर्ता से बाहर निकालता है एक 'पाठ देखें' और आउटपुट प्रदर्शित के रूप में तुरंत एक 'रीसायकल दर्शक' नीचे.
एक तरीका है ऐसा करने के लिए, के साथ एक बहुत बड़ी संख्या के आईएफएस. क्या आप सुझाव है कि एक अन्य विधि?
मैं का उपयोग करें Roon पुस्तकालय के लिए अपने आवेदन के एक डेटाबेस है ।
मैं चाहता था करने के लिए इस कोड का उपयोग इस के लिए लेकिन मैंने देखा है कि संख्या के आईएफएस बहुत अधिक है ।
एक दोस्त का सुझाव दिया उपयोग के मामले में डेटाबेस है, लेकिन मैं नहीं जानता कि कैसे लिखने के लिए अपने कोड!
public void searchHelper() { String sOperationValue = spinnerOperation.getText().toString(); String sTraderValue = spinnerTraderName.getText().toString(); String sSearchByValue = spinnerSearchBy.getText().toString(); long startValue = Long.parseLong(etStartDate.getText().toString()); long endValue = Long.parseLong(etEndDate.getText().toString()); // * * * * * if (!sOperationValue.isEmpty() && !sTraderValue.isEmpty() && !sSearchByValue.isEmpty() && startValue >= 14000000 && endValue <= 15000000) { } // * - * * * if (!sOperationValue.isEmpty() && sTraderValue.isEmpty() && !sSearchByValue.isEmpty() && startValue >= 14000000 && endValue <= 15000000) { } // * - - - - if (!sOperationValue.isEmpty() && sTraderValue.isEmpty() && sSearchByValue.isEmpty() && startValue <= 0 && endValue <= 0) { } // - * * * * if (sOperationValue.isEmpty() && !sTraderValue.isEmpty() && !sSearchByValue.isEmpty() && startValue >= 14000000 && endValue <= 15000000) { } // Here 'Search By' specifies whether the search should be based on the date of registration or on the date of the transaction. // Therefore, when Search By is empty, then the start date and end date values are also empty. // - * - - - if (sOperationValue.isEmpty() && !sTraderValue.isEmpty() && sSearchByValue.isEmpty() && startValue <= 0 && endValue <= 0) { } // - - * * * if (sOperationValue.isEmpty() && sTraderValue.isEmpty() && !sSearchByValue.isEmpty() && startValue >= 14000000 && endValue <= 15000000) { } // - - - - - if (sOperationValue.isEmpty() && sTraderValue.isEmpty() && sSearchByValue.isEmpty() && startValue <= 0 && endValue <= 0) { } }
मैं भी चाहता था लिखने के लिए एक क्वेरी का उपयोग कर के मामले में, लेकिन असफल रहा । यह था के मैं ने लिखा कोड
@Query("SELECT * FROM tbl_transaction" + " WHERE CASE WHEN operation='null'" + " THEN CASE WHEN traderName='null'" + " THEN CASE WHEN transactionType ='null'" + " THEN CASE WHEN startDate=14000000" + " THEN CASE WHEN endDate=15000000" ) List<Transaction> getSearchValues(String operation, String traderName, String transactionType, long startDate, long endDate);
हालांकि मैं बहुत था के लिए देख रहे हैं सही समाधान है, दुर्भाग्य से मैं नहीं मिल सकता है.
धन्यवाद आपकी मदद के लिए अग्रिम.